Using VBA Functions

This procedure is an example of how to use VBA functions in Smart View, using HypConnect as an example.

Note:

For information on using Visual Basic Editor, see Excel documentation.

  To set up HypConnect:

  1. Ensure that the worksheet is active.

  2. From Excel, open Visual Basic Editor and import smartview.bas, located by default in EPM_ORACLE_HOME/smartview/bin.

    Tip:

    For convenience, maintain the entire contents of smartview.bas in a separate module and copy from it as needed.

  3. Open a module and enter VBA code for the function you want to use, in this example:

    Sub Conn()
       X=HypConnect(vtSheetName, User, Password, vtFriendlyName)
    End Sub

    Substitute your user name, password, and connection name for the data source provider.

  4. Create a command button.

  5. Assign a macro to the command button using the name of the subroutine; in this example, Conn.

  6. Optional: Rename the button.

  7. To run this function, click the button that you just created.