REGISTER.ID

Called from a macro sheet or DLL. If a function is already registered, returns the existing register ID for that function without reregistering it. If a function is not yet registered, registers it and returns a register ID.

Returns the register ID of the function (xltypeNum), which can be used in subsequent CALL and UNREGISTER calls.

Syntax

From a macro sheet:

REGISTER.ID(module_text,procedure,type_text)

From a DLL:

Excel4(xlfRegisterId, LPXLOPER pxRes, 3, LPXLOPER pxModuleText,
LPXLOPER pxProcedure, LPXLOPER pxTypeText);

module_text (xltypeStr)

The name of the DLL containing the function.

procedure (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.

type_text (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 following "Remarks" section. This argument can be omitted for a stand-alone DLL (XLL) defining xlAutoRegister.

Remarks

This function is useful when you don't want to worry about maintaining a register ID, but 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.

Related Functions

CALL, REGISTER, UNREGISTER