xlAutoClose

Provided by every stand-alone DLL. This entry point is called by Microsoft Excel when the user quits. It is also called when a Microsoft Excel macro calls UNREGISTER, giving a string argument that is the name of this XLL. This entry point will be called when the Add-In Manager is used to remove this XLL.

Must return 1 (int).

Syntax

int WINAPI xlAutoClose(void);

This function has no arguments.

Remarks

This function should:

This function does not have to unregister the functions that were registered in xlAutoOpen. Microsoft Excel automatically does this after xlAutoClose returns.

Example

\SAMPLES\FRAMEWRK\GENERIC.C

int WINAPI xlAutoClose(void)
{
    int i;

    /*
    ** This block first deletes all names added by xlAutoOpen or by
    ** xlAutoRegister.
    */

    for (i = 0; i < rgFuncsRows; i++)
        Excel(xlfSetName, 0, 1, TempStr(rgFuncs[i][2]));

    return 1;
}

Related Function

xlAutoOpen