XLL+ Class Library

CXlOper::Excel

Invoke the Excel SDK

[C++]
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 XLOPER. References to the CXlOper class will automatically be cast to XLOPER*.

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.

The result of the call will be put in the object which made it. The CXlOper will be marked for special memory clean-up, since the data returned is owned by Excel. If you have no interest in the value returned by Excel, use CXllApp::Excel() instead.

CXlFuncs & CXlMacros

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

Example

CXlOper::Excel() Example

Requirements

Header: xllplus.h

See Also

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