XLL+ Class Library (6.3)

CXlOper::Excel

Invoke the Excel SDK

int cdecl Excel(
   int xlfn,
   int count,
   const CXlOper* pxlo,
    ...
);
int cdecl Excel(
   int xlfn,
   int count,
   const XLOPER4* pxlo4,
    ...
);
int cdecl Excel(
   int xlfn,
   int count,
   const XLOPER12* pxlo12,
    ...
);
int cdecl Excel(
   int xlfn,
   int count,
   const CXlOper*[] array_xlo
);
int cdecl Excel(
   int xlfn,
   int count,
   const XLOPER4*[] array_xlo4
);
int cdecl Excel(
   int xlfn,
   int count,
   const XLOPER12*[] array_xlo12
);

Parameters

xlfn

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

count

The number of arguments being passed to Excel.

pxlo

A pointer to an initialized CXlOper object.

...

The remaining count-1 arguments to the function should be of a the same type as the first argument.

pxlo4

A pointer to an initialized XLOPER4 structure.

pxlo12

A pointer to an initialized XLOPER12 structure.

array_xlo

A pointer to an array of count initialized CXlOper pointers.

array_xlo4

A pointer to an array of count initialized XLOPER4 pointers.

array_xlo12

A pointer to an array of count initialized XLOPER12 pointers.

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 Codes.

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