xlfSetName

Last modified: March 18, 2009

Applies to: Excel 2010 | Office 2010 | VBA | Visual Studio

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


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

pxNameText (xltypeStr)

The name of the range, which should conform to the usual limitations in Microsoft 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.

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.

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.

Show:
© 2015 Microsoft