Before you can use the Essbase Visual Basic functions in an Excel module, you must declare them at the top of the module. A declaration outlines the necessary elements of the function so Visual Basic can run it. You can declare only those functions you plan to use, or you can declare all Essbase VBA functions.
To declare all Essbase VBA functions:
Move the cursor to the top of the module.
Select Insert, and then File.
In Insert File , select /ESSBASE/BIN/ESSXLVBA.TXT.
The file is copied into the module. Now you can use the Essbase Excel VBA function in your program. Delete declarations for functions that you do not need in your module.
To declare individual Essbase VBA functions:
Move the cursor to the top of the module.
Enter the declarations for the functions you are using.
See the description of each function for its declaration, or see ESSXLVBA.TXT. For example:
Declare Function EssVCalculate Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant, ByVal calcScript As Variant, ByVal synchronous As Variant) As Long
Notes:
When typing the declaration, observe these guidelines:
Do not substitute values for parameter names. In the EssVCalculate example, the first parameter is sheetName. In the declaration, you enter it as sheetName. When you call the EssVCalculate function in your VBA module, you substitute the name of the worksheet.
Enter the declaration on one line.