XLL+ Class Library

CXllApp::Excel

Invoke the Excel SDK

[C++]
static int cdecl Excel(
   int xlfn,
   int count,
    ...
);

Parameters

xlfn

The Excel built-in function number. See Excel built-in function numbers for a list of values.

count

The number of XLOPER pointer arguments being passed to Excel.

...

The remaining count arguments to the function should be pointers to CXlOper.

Return value

The result of the SDK call-back. xlretSuccess (0) indicates success. Other values indicate failure. A full list of return values can be found under Error Values.

Remarks

This function can be used to call an Excel built-in function via the Microsoft Excel SDK. Details of SDK calls and their arguments can be found in the Microsoft Excel 4 Function Reference.

This function should not be used if you have any interest in the value returned by the callback function. To receive a return value, use CXlOper::Excel(), which places the result in the calling CXlOper object.

Since this function is static, it is not necessary to use an instance of CXllApp to invoke it. It is not therefore necessary to fix the MFC CWinApp instance using the XLL_FIX_STATE macro: you can use code such as:

    CXlOper xloBarNum;
    xloBarNum.ToInt(2);
    CXllApp::Excel(xlfDeleteToolbar, 1, xloBarNum);

CXlFuncs & CXlMacros

Most Excel worksheet and macro functions can be found, as ready-wrapped C++ methods, in the CXlFuncs and CXlMacros classes respectively.

Requirements

Header: xllplus.h

See Also

CXllApp Class | CXllApp Methods | CXlOper::Excel | Error Values | CXlFuncs class | CXlMacros class | Excel built-in function numbers | Calling an Excel built-in function from your add-in