XLL+ Class Library (6.3)

XLL+ extension files

Testing and examining an extension file

To validate the extension file, click on the Test button. A report window should appear, confirming that one file was loaded without errors. Close the window.

Examine the loaded types by pressing the View button. This will show a list of all the extensions in the list. In the tree on the left, select the node "Scalar types/Date".

Notice that all the properties in the list on the right are in grey, meaning that they are read-only: you can't edit the extended types here, only look at them. (To edit a type, you need to work with the definition file, as we will do in a moment.)

Let us examine some of the more important properties of the type:

Name

The name of the extension (in our case "Date") is the identifier for the type within the XLL+ code generation system. It must not conflict with the names of any built-in types or of other extended types.

CppType

This is the type of the target variable, which in our case is long.

NativeType

This is the type used to store the value within Excel; in our case, Double.

ConverterType

The ConverterType holds the name of the C++ class which will do the work of converting and validating the input. For this example, the class is psl::DateConverter.

HeaderFiles

HeaderFiles holds a list of C++ header files which will be needed in order to compile the generated code. In our case, it is the file extensions\DateConverter.h, which contains the definition of the converter class, psl::DateConverter.

The Extension File

Next, let's examine the file itself. Close the XLL+ Extensions window, if it is still open, and use the Edit button in the XLL+ Options / Extensions page to open up the extension file in the Visual Studio editor.

Click the OK button to close the Options dialog and save your changes.

Like the Help file, the extension file has a schema which provides the user with:

Locate the <ScalarType> element. All the important definitions are contained in its attributes:

CopyXML
<ScalarType name="Date" cppType="long" excelType="Double"  
            converterType="psl::DateConverter" optionalAllowed="true"  
            headerFiles="extensions\DateConverter.h">

The <ScalarType> element also contains a <LocalizedDisplayName> element and a <LocalizedDescription> element. These elements control the display of localized help and identifiers in the XLL+ Function Wizard. If all your developers use the same language then these can be safely omitted.

For more details of the extension file format, examine the full schema of the XLL+ extension file in the reference.

Next: Using an extended type >>