Excel12, Excel12v
These functions can only be called when Excel has passed control to the XLL (but not, for example in DllMain
).
Prior to Excel 2007, these functions were named Excel4
and Excel4v
.
int Excel12(
int iFunction,
LPXLOPER12 pxRes,
int iCount,
LPXLOPER12 argument1,
...
);
iFunction
The value of iFunction can be one of the following constants:
xlAbort | |
xlAsyncReturn | |
xlCoerce | |
xlDefineBinaryName | |
xlDisableXLMsgs | Deprecated |
xlEnableXLMsgs | Deprecated |
xlEventRegister | Introduced in Excel 2010 |
xlFree | |
xlGetBinaryName | |
xlGetHwnd | |
xlGetInst | |
xlGetName | |
xlRunningOnCluster | |
xlSet | |
xlSheetId | |
xlSheetNm | |
xlStack | |
xlUDF | |
xlfCaller | |
xlfEvaluate | |
xlfGetDef | |
xlfGetName | |
xlfRegister | Two forms |
xlfRegisterId | |
xlfUnregister | Two forms |
xlfSetName | |
xlcSelect | |
xlc… | Are there other xlc constants? |
Framework library functions
The framework library functions makes writing XLLs easier.
debugPrintf | |
GetTempMemory | |
FreeAllTempMemory | |
InitFramework | |
QuitFramework | |
Excel12f | |
TempNum12 | |
TempStr12 | |
TempStr12Const | |
TempBool12 | |
TempInt12 | |
TempErr12 | |
TempActiveRef12 | |
TempActiveCell12 | |
TempActiveRow12 | |
TempActiveColumn12 | |
TempMissing12 | |
These functions are found in framewrk.c
(framewrk.h
) and framewrk.lib
.
xlcall.h
Some interesting typedefs in xlcall.h
.
Excel (XLL) uses wide characters for strings:
typedef WCHAR XCHAR;
Rows, columns and sheet IDs:
typedef INT32 RW;
typedef INT32 COL;
typedef DWORD_PTR IDSHEET;
XLOPER12
XLOPER12
is a union
that combines the following fields in val
. How val
is interpreted is defined in the member xltype
(which is a DWORD
).
.val | Type | .xltype | |
num | double | xltypeNum | |
str | LPSTR | xltypeStr | |
xbool | BOOL | xltypeBool | |
err | int | xltypeErr | |
w | int | xltypeInt | |
sref | struct | xltypeSRef | |
mref | struct | xltypeRef | |
array | struct | xltypeMulti | |
flow | struct | xltypeFlow | |
bigdata | struct | xltypeBigData | |
LPXLOPER12
is pointer to XLOPER12
XLOPER12
was introduced with Excel 2007 to accomodate larger grids and to support Unicode strings.