Share via


xlAutoRemove

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.

Called by Microsoft Office Excel whenever the user deactivates the XLL during an Excel session by using the Add-In Manager. This function is not called when an Excel session closes, normally or abnormally, with the add-in installed.

This function can be used to display a custom dialog box telling the user that the add-in has been deactivated, or to read from or write to the registry, for example.

Excel does not require an XLL to implement and export this function.

int WINAPI xlAutoRemove(void);

Parameters

This function takes no arguments.

Property Value/Return Value

Your implementation of this function must return 1 (int).

Remarks

Use this function if your XLL needs to complete any task when it is removed by the Add-In Manager.

Example

See the files \SAMPLES\EXAMPLE\EXAMPLE.C and \SAMPLES\GENERIC\GENERIC.C for example implementations of this function. The following code is from \SAMPLES\EXAMPLE\EXAMPLE.C.

int WINAPI xlAutoRemove(void)
{
/* Display a dialog box indicating that the XLL was successfully removed */
   Excel12f(xlcAlert, 0, 2,
      TempStr12(L"Thank you for removing Example.XLL!"),
      TempInt12(2));
   return 1;
}

See Also

Reference

xlAutoAdd

Concepts

Add-in Manager and XLL Interface Functions