XLL+ Class Library

COper Class

[C++]
class COper

Overview

A COper object encapsulates the OPER structure. This structure is used by the Excel SDK; specifically, the data type is used to pass data from Excel to add-in functions 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.

    Data types

    The table below lists the data types supported by the COper class.

    Type'C' typeDescription
    xlotypeNumdouble IEEE floating-point number (8 bytes)
    xlotypeStrLPSTR Zero-terminated ASCII string (limited to 255 characters)
    xlotypeBoolBOOLBoolean
    xlotypeErrWORD Error value. For a full list of error values, see the section Error codes in XLCALL32.H.
    xlotypeMultiarrayArray of OPERs
    xlotypeMissingvoid A missing optional argument, omitted by the user

    COper versus CXlOper

    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.

    Requirements

    Header: xllplus.h

    See Also

    COper Methods | xllplus.h | CXlOper object