HypExecuteCalcScript

Data source types: Essbase

Description

HypExecuteCalcScript() uses a calculation script (business rule script) to initiate a calculation on the server.

Syntax

HypExecuteCalcScript (vtSheetName, vtCalcScript, bSynchronous)

ByVal vtSheetName As Variant

ByVal vtCalcScript As Variant

ByVal bSynchronous As Boolean

Parameters

vtSheetName: For future use. Currently the active sheet is used.

vtCalcScript: Text name of the calculation script on the Analytic Server in the database directory to run. To run the default calculation script, use "Default".

bSynchronous: Boolean value indicating whether the calculation script should be run synchronously. If synchronous is Null or Empty, True is used. Currently this flag is unused.

Return Value

Returns 0 if successful; otherwise, returns the appropriate error code.

Example

Declare Function HypExecuteCalcScript Lib "HsAddin" (ByVal vtSheetName As Variant, ByVal vtCalcScript As Variant, ByVal bSynchronous As Variant) As Long 

Sub RunCalculate() 
X = HypExecuteCalcScript (Empty, "Default", False)
   If X = 0 Then
      MsgBox("Calculation complete.") 
   Else
      MsgBox("Calculation failed.") 
   End If 
End Sub