Architecture

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:

  1. Invoking the XLL add-in function with the required argument stack, and returning the result to the calling code.
  2. Handling calls made by the add-in function to the Excel API, via the Excel4() callback function.

Flow diagram

XLL Host flow diagram

The diagram summarizes the various calls.

  1. The .NET application calls the .NET objects in the generated wrapper library.
  2. 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).
  3. The XLL Host module invokes the add-in function in the XLL.
  4. 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.
  5. 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.