The XLL Host module and its associated .NET assemblies provide hosting for XLL add-ins, in the absence of Excel.
The architecture provides two important functions:
- Invoking the XLL add-in function with the required argument stack, and returning the result to the calling code.
- Handling calls made by the add-in function to the Excel API, via the Excel4() callback function.
The diagram summarizes the various calls.
- The .NET application calls the .NET objects in the generated wrapper library.
- The auto-generated wrapper library methods call the XLL Host runtime assembly (XllHost.ComWrappers.Runtime.dll), which in turn calls the XLL Host module (pslxld02.dll).
- The XLL Host module invokes the add-in function in the XLL.
- If the XLL makes any Excel API callbacks, these are routed via a special version of XLCALL32.DLL, which passes them straight back to the XLL Host module.
- The XLL Host module passes the API call to each registered Excel emulator module in turn, until one of the emulators responds.
For more information about Excel plug-in emulators, see How to build a Plug-in Emulator.