Type mismatch passing arrays via COM

D

Dan Neely

I'm trying to pass an array from my VBA app into managed COM
component but am getting "Type mismatch: array or user-defined type
expected error" on the array name where it's being used as a parameter
to the COM call.

The COM method (in C#) is declared as follows:

[ComVisible (true)]
public void TrippleArray(ref double[] input)
{ /*implementation*/ }


I'm trying to call it in VBA using this:

Dim tester As New MyAddin3.Connect
Dim inputNums(10) As Double
' load numbers into inputNums

tester.TrippleArray (inputNums)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top