[C++]
class CXlOper
A CXlOper object encapsulates the XLOPER structure. This structure is used by the Excel SDK; specifically, the XLOPER data type is used to return data to Excel under the following circumstances:
Passing values which can contain various data types Passing arrays Passing optional arguments
See also Comparison of COper, CXlOper and CXlArray types.
The table below lists the data types supported by the CXlOper class.
Type | 'C' type | Description |
---|---|---|
xltypeNum | double | IEEE floating-point number (8 bytes) |
xltypeStr | LPSTR | Zero-terminated ASCII string (limited to 255 characters) |
xltypeBool | BOOL | Boolean |
xltypeErr | WORD | Error value. For a full list of error values, see the Error codes. |
xltypeMulti | array | Array of XLOPERs |
xltypeSRef | sref | Reference to a single range of cells |
xltypeRef | mref | Reference to one or more ranges of cells |
COper is the best way to pass arguments from Excel to your XLL if they are of variable type, are arrays or are optional.
CXlOper is the best way to return data from your XLL if the result is of variable type, an array or a string. In particular, error handling can only be satisfactorily managed if the return type is an XLOPER. In addition, CXlOper is the only way to pass cell references from Excel to XLL add-in functions.
See also Comparison of COper, CXlOper and CXlArray types.
Header: xllplus.h