I do C# excel interop. I call macros from C#, and I expect arrays of objects. I'm able to get 2-dimensional arrays of objects from the macros which returns 2-dimensional arrays.

However, an other (third party) macro is supposed to return a one-dimensional array. I can't get the (object[])xlApp.Run(...) working (it throws an exception), and the type info in the debugger says the result is of type Object[*]. The actual message from the exception is

Unable to cast object of type 'System.Object[*]' to type 'System.Object[]'.

What is this Object[*] type and how do I retrieve a one-dimensional array from this ?

EDIT: It occurred to me that this could mean a SAFEARRAY of VARIANTS. But then, two questions arise: why is everything ok with 2-dimensional arrays ? How do I convert a SAFEARRAY to a C# array ?

Edit
Report