xlfUnregister (Form 2)
Published: July 16, 2012
Can be called from a DLL or XLL command that has itself been called by Microsoft Excel. This is equivalent to calling UNREGISTER from an Excel XLM macro sheet.
xlfUnregister can be called in two forms:
Form 1: Unregisters an individual command or function.
Form 2: Unloads and deactivates an XLL.
Called in Form 2, this function forces a DLL or code resource to be unloaded completely. It unregisters all of the functions in a DLL, even if they are currently in use by another macro, no matter what the use count. This function calls xlAutoClose, and then unregisters all the functions in the DLL.
Note: Do not call this form of the function from your implementation of the xlAutoClose in an attempt to unregister all of the DLL's resources with one simple function call. This leads to recursive calling of xlAutoClose and a stack overflow.
Remember to Delete Names
If you specified the pxFunctionText argument to xlfRegister, when registering the DLL's functions and commands, you must explicitly delete the names by calling xlfSetName for each one, omitting the second argument so that the function no longer appears in the Function Wizard. For more information, see Known Issues in Excel XLL Development.