I have a an Excel addin written in C# I am trying to call from VBA in Excel. In VBA I generate several arrays to pass:
Dim Identifiers() As Variant
Dim Variables() As Variant
Dim Times() As Variant
...
Dim QaddIn As COMAddIn
Dim QTool As Object
Dim results As Variant
Set QaddIn = Application.COMAddIns("QTool")
QaddIn.Connect = True
Set QTool = QaddIn.Object
results = QTool.GetQData(datasetName, Identifiers, Variables, Times, timeString)
GetQData is defined in C# as:
string[] GetQData(string DatasetName, object[] Identifiers, object[] Variables, object[] TimeCodes,
string TimeString);
But when I run the code, VBA throws the error object of type 'system.object[*]' cannot be converted to object of type 'system.object[]'. This same code worked fine passing variant arrays defined with a static length, as in Dim Identifiers(3) As Variant. What is the difference between what I am trying to pass now?