Office 2013 and later

Last modified: July 01, 2011

Applies to: Excel 2013 | Office 2013 | Visual Studio

Can be called from a DLL that has itself been called by Microsoft Excel. If a function is already registered, it returns the existing register ID for that function without reregistering it. If a function is not yet registered, it registers it and returns the resulting register ID.

Excel12(xlfRegisterId, LPXLOPER12 pxRes, 3,     LPXLOPER12 pxModuleText, LPXLOPER12 pxProcedure, LPXLOPER12 pxTypeText);

pxModuleText (xltypeStr)

The name of the DLL containing the function.

pxProcedure (xltypeStr or xltypeNum)

If a string, the name of the function to call. If a number, the ordinal export number of the function to call. For clarity and robustness, always use the string form.

pxTypeText (xltypeStr)

An optional string specifying the types of all the arguments to the function and the type of the return value of the function. For more information, see the "Remarks" section. This argument can be omitted for a stand-alone DLL (XLL) defining xlAutoRegister.

Returns the register ID of the function (xltypeNum), which can be used in subsequent calls to xlfUnregister.

This function is useful when you do not want to worry about maintaining a register ID, but you need one later for unregistering. It is also useful for assigning to menus, tools, and buttons when the function you want to assign is in a DLL.

Where a DLL or XLL function has been registered with a valid pxFunctionText argument having been supplied to xlfRegister, its register ID can also be obtained by passing the pxFunctionText to the function xlfEvaluate.