XLL+ Class Library

Using the wrapper generator

Starting the COM Wrapper Generator

The help generator utility ComWrapperGen.exe can be found in the Bin/ComWrapperGen sub-directory of your XLL+ installation. There is a short-cut to ComWrapperGen in the XLL+ folder of the program menu.

Using the COM Wrapper Generator

Instructions

  1. Press Add... or Remove to edit the list of Source files. The XLL+ add-in functions contained in each input file will be added to the list of functions exported by the COM object.
  2. Set the Project name (which will also be the name of the COM library) and the Class name (which will be the name of the COM object within the library). Ensure that the project name and class name are different.
  3. Set the error handling behavior.
  4. Set the Destination folder. If the directory does not exist, the generator will create it.
  5. Press Create to generate files. All existing files will be replaced.
  6. Open the Visual Basic 6 project. Optionally, change the code in the sections marked "TODO". Compile the COM object.
  7. It is advisable, if you are supplying the COM object to other developers, to supply documentation of each exported function. You can use the Help Generator to generate a help file for this purpose.

Controls

ControlDescription
Source files List of the source files which will be inspected for add-in functions. Each function found will be exported as a COM method. Add and remove files in the list with the Add and remove buttons.
Add... Add a source file to the list.
Remove Remove the selected source file from the list.
Project name This will be used as the name of the VB project, and (by default) as the name of the COM library.
Class name This will be used as the name of the COM object class. It is normally the name of the XLL (without the ".xll" extension). If it is not the name of the XLL, then you will need to change the code in the GetAddins event handler.
Excel error type handler Controls whether the generated COM methods will throw an error if an Excel error type (e.g. #N/A) is returned by the wrapped add-in function. See Error handling for more details.
String error prefix Controls whether the generated COM methods will throw an error if a string with the supplied prefix is returned by the wrapped add-in function. See Error handling for more details.
Implementation Controls which implementation model will be used to host the add-in functions. See ExcelWrapper class for more details.
Destination folder The directory where the VB project files will be written. If the directory does not exist (but its parent does), the generator will create it.
Create Run the generator. All existing files will be overwritten.
Close Close the generator window.
Help Show this documentation.

See Also

XLL+ COM wrapper generator | Generated code | Calling the COM methods