Share via


xlfSetName

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Used to create and delete defined names associated with the DLL.

Excel12(xlfSetName, LPXLOPER12 pxRes, 2,
    LPXLOPER12 pxNameText, LPXLOPER12 pxNameDefinition);

Parameters

pxNameText (xltypeStr)

The name of the range, which should conform to the usual limitations in Microsoft Office Excel on valid names.

pxNameDefinition (xltypeStr, xltypeNum, xltypeBool, xltypeErr, xltypeMulti, xltypeSRef, xltypeRef, or xltypeInt)

(Optional). The value, set of values, cell, or range of cells that pxNameText is defined as. If omitted, the name is deleted.

Property Value/Return Value

pxRes (xltypeBool or xltypeErr)

TRUE if the operation succeeded or FALSE if the name could not be created or deleted. Returns #VALUE! if one or more of the arguments was invalid.

Remarks

When a function or command is registered using xlfRegister with a valid pxFunctionText argument, Excel creates a name associated with the DLL resource. When your DLL is being unloaded, such names should be deleted using the xlfSetName function. However, due to a known issue in Excel, this deletion operation fails. For more information, see Known Issues in Excel XLL Development.

Example

See the code for the xlAutoClose function in \SAMPLES\GENERIC\GENERIC.C.

See Also

Concepts

Essential and Useful C API XLM Functions