CitectVBA Programming Reference > CitectVBA Function Reference > Procedural Statements > VbCallOpen function

VbCallOpen function

The VbCallOpen function is a Cicode function used to call a CitectVBA function or subroutine from Cicode. It is used to initiate a call to the CitectVBA function or subroutine and returns a handle (of OBJECT data type) to that opened function call.

VbCallOpen is used in conjunction with VbCallRun and VbCallReturn functions, which can all be nested to implement the entire function set with a single line of Cicode. For further information, see the section "Calling CitectVBA from Cicode".

Syntax

ReturnValue = VbCallOpen(FunctName, ArgList)

ReturnValue:

The handle to the opened CitectVBA function.

FunctName:

The name of the CitectVBA function or subroutine being called.

ArgList:

A comma separated list of arguments to pass to the function or subroutine being called.

Return Value

VbCallOpen returns an Object data type containing a handle to the CitectVBA function being called. If the function cannot open the CitectVBA function or subroutine the return value is zero.

Related Functions

VbCallRun function | VbCallReturn function

Example

FUNCTION
TestCitectVBA()
INT iRet;
STRING sMsg = "Hello";
INT iVal = 123;

iRet = VbCallReturn(VbCallRun(VbCallOpen("CiVBATest", iVal)));
Message("TestCitectVBA Function", "CiVBATest = " + IntToStr(iRet), 0);
END

Example

Function CiVBATest(Value As Integer) As Integer
CiVBATest = Value * 2
End Function