CallUDF
Applies to: Excel 2013 | Office 2013 | Visual Studio
Calls a user-defined function in a high-performance computing environment.
int CallUDF(int SessionId, WCHAR *XllName, WCHAR *UDFName, LPXLOPER12 pxAsyncHandle, int (*CallBackAddr)(), int ArgCount, LPXLOPER12 Parameter1, ...)
Parameters
SessionId
The ID of the session in which to make the call.
XLLName
The name of the XLL that contains the user-defined function.
UDFName
The name of the user-defined function.
CallBackAddr
The function that the connector should call when the user-defined function is finished.
pxAsyncHandle
The asynchronous handle used by Excel and the connector to track the pending user-defined function call. The connector uses it later when the call is finished, when it calls back into Excel using the function pointer passed in the CallBackAddr argument.
ArgCount
The number of arguments to pass to the user-defined function. The maximum value allowed is 255.
Parameter1
A value to pass to the user-defined function. Repeat this argument for each parameter indicated by ArgCount.
Return value
xlHpcRetSuccess if the UDF call is successfully initiated; xlHpcRetInvalidSessionId if the SessionId argument is invalid; xlHpcRetCallFailed on other failures, including time-out. If the call returns any error code (anything except xlHpcRetSuccess), then Excel considers the UDF call to have failed, invalidates the pxAsyncHandle, and does not expect a callback to occur.
Remarks
This function executes asynchronously.