Published: July 16, 2012
Calls a user-defined function (UDF). This function allows a DLL to call Visual Basic for Applications (VBA) user-defined functions, XLM macro language functions, and registered functions contained in other add-ins.
pxFnRef (xltypeRef, xltypeSRef, xltypeStr or xltypeNum)
The reference of the function you want to call. This can be a macro sheet cell reference, the registered name of the function as a string, or the register ID of the function. For XLL add-in functions registered using xlfRegister or REGISTER with the argument pxFunctionText supplied, the ID can be obtained by using xlfEvaluate to look up the name.
Zero or more arguments to the user-defined function. When you are calling this function in versions earlier than Excel 2007, the maximum number of additional arguments that can be passed is 29, which is 30 including pxFnRef. Starting in Excel 2007, this limit is raised to 254, which is 255 including pxFnRef.
The following example runs TestMacro on sheet Macro1 in BOOK1.XLS. Make sure that the macro is on a sheet named Macro1.