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

VbCallReturn function

Used to obtain the return value of the completed CitectVBA function (previously opened with the Cicode VbCallOpen function), and requires the handle returned from the VbCallRun function call.

VbCallReturn is used in conjunction with VbCallOpen and VbCallRun 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.


ReturnValue = VbCallReturn(CallHandle)


The value returned by the completed CitectVBA function (which was previously opened by the Cicode VbCallOpen function). The data type of the return value is dependent upon the data type of the return value for the CitectVBA function opened.


The handle to the previously opened CitectVBA function as returned by the Cicode VbCallRun function

Return Value

VbCallReturn returns the completed return value for the CitectVBA function.

Related Functions

VbCallOpen function | VbCallRun function


INT iRet;
STRING sMsg = "Hello";
INT iVal = 123;

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


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