What is the proper way to pass an array of user defined classes from vba to .net (specifically c#) using com-interop?
Here's my c# code. If I call Method1 from vba it's failing with "Array or userdefined type expected" or "Function uses an automation type not supported in visual basic".
public class MyClass
{
public Method1(UserDefinedClass[] Parameters) { ... }
public Method2(Object Parameters) { ... }
}
I've read a bit about the MarshallAsAttribute class. Could this be the missing piece in the c# code?
Here's the vba code I'm using:
Dim udt As New UserDefinedClass
Dim myArray()
myArray(1) = udt
myClass.Method1(myArray)
myClass.Method2(myArray)