EssVCalculate

Description

Initiates a calculation on the server using a calculation script.

Syntax

EssVCalculate(sheetName, calcScript, synchronous) 
ByVal sheetName As Variant
ByVal calcScript As Variant
ByVal synchronous As Variant

Parameters

sheetName

Text name of worksheet to operate on. sheetName is of the form "[Book.xls]Sheet". If sheetName is Null or Empty, the active worksheet is used.

calcScript

Text name of the calculation script on the server in the database directory to run. To run the default calculation script, use "[Default]". If calcScript is Null or Empty, a dialog box prompts the user for a calculation script to run.

synchronous

Boolean value indicating whether the calculation should be run synchronously. If synchronous is Null or Empty, True is used.

Return Value

Returns 0 if successful. A negative number indicates a local failure (see VBA Return Values). A return value greater than zero indicates a failure on the server.

Example

Declare Function EssVCalculate Lib "ESSEXCLN.XLL" (ByVal sheetName As Variant, ByVal calcScript As Variant, ByVal synchronous As Variant) As Long

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