The Generic Template for XLLs

The sample code in the FRAMEWRK directory contains a template you can use for writing your own Microsoft Excel XLLs. This code demonstrates many of the features of the Microsoft Excel C API. To see the generic add-in code, open GENERIC.C.

When you open the compiled generic add-in (GENERIC.XLL) in Microsoft Excel, it creates a new Generic menu with the four commands listed in the following table.

Command

Action

Dialog

Displays a Microsoft Excel dialog box

Dance

Moves the selection around until you press ESC

Native Dialog

Displays a Windows dialog box that was created using the Windows API

Exit

Closes GENERIC.XLL or Generic and removes the menu


The generic add-in also provides two functions, Func1 and FuncSum, that can be used whenever the generic add-in is open. These functions appear in the Generic Add-In category in the Paste Function dialog box. Also, these functions can be registered without loading all of the generic add-in. To do this, use the following formula:

=REGISTER("GENERIC.XLL","FUNC1")
=REGISTER("GENERIC.XLL","FUNCSUM")