XLL+ Class Library (7.0)


Transform an Excel matrix containing values of unknown type to a two-dimensional CLR object array

array<System::Object^, 2> toClrObjectMatrix(
   const CXlOper& xloValue,
   const wchar_t* argName



An array value received from Excel. This can be a single cell, a vector of cells or a matrix of cells.

Note: if this value is specified as a parameter of the add-in function, it must be of type "Value", and not type "Reference". If the parameter has been passed as type "Reference", then the value must be extracted, using CXlOper::Coerce().


The name of the argument that is being converted. This will be used in error messages.

Return Value

A two-dimensional CLR object array, that may be passed directly to a .NET method, using C++/CLI.


If the function fails for any reason, an exception of type CXlConversionException is thrown. This will be caught by the outer wrapper function, and converted into an appropriate form to be returned to Excel.


Header: xlpclrconvert.h

See Also

Common Language Runtime support functions | toClr | toClrObject | toClrObjectVector