Click or drag to resize


Documentation for the xll library classes.

General Considerations

The basic data structure is a C struct called XLOPER. It represents a *cell* or *range* of cells in a spreadsheet. A cell can be a number, string, boolean, reference, error, or integer. A range is a two dimensional array of cells having at most 64K rows and 256 columns.

Excel 2007 introduced a new C struct, XLOPER12, that allows wide-character strings and ranges that can have up to 1M rows and 64K columns.

To write code that can be built for either old or new versions of Excel use XLOPERX. It defaults to XLOPER when you include xll.h. If you #define EXCEL12 before including this header it becomes XLOPER12.

The library defines the C++ classes OPER/OPER12. They are XLOPERs with constructors, destructors, and member functions that to make them behave like C++ built-in types. Even though C++ is strongly typed, OPERs act as variant types.

Connecting Excel to your C++ code is accomplished by the class AddIn/AddIn12/AddInX. It tells Excel the return type, what name to use, and what the arguments are.