Creating Stand-Alone DLLs (XLLs)

Up to this point, only DLLs that are registered and called from macro sheets have been discussed. However, Microsoft Excel 4.0 and greater also supports stand-alone DLLs. These are DLLs (or code resources) that the user opens by choosing Open from the File menu and selecting a DLL file or by using the Microsoft Excel Add-In Manager. (The user can also put DLL files in the Microsoft Excel startup directory, in which case they are opened at run time.) By convention, stand-alone DLLs are called XLLs. They should be given a file name with the extension .XLL for Windows.

Note

The easiest way to create a stand-alone XLL is to start with the sample generic code provided in the FRAMEWRK subdirectory or folder.

When using an XLL, the user never sees a macro sheet or add-in sheet. Therefore, an XLL must be able to do everything an XLA (add-in) can do. In particular, XLLs need a way to provide functions that run automatically at open time, close time, and so on.

When developing an XLL, you need to: