Variant Type Mismatch in VB6

Viewed 116

I'm trying to code up a call to a method whose second parameter appears to be a variant (so far as I can tell from the object browser, anyway).

It is customary in the application I am working on to call it like this:-

Call StrangeMethod ("Fred", Array (1, 2, 3, 4))

But when I try to call it like this:-

Dim myArray as Variant
myArray = Array(1, 2, 3, 4)
Call StrangeMethod("Fred", myArray)

the call fails with a Type Mismatch error. What am I doing wrong here and how do I correct it?

Edit As requested in the comments, the method signature in the object browser is:-

Strangemethod(Path As String, Commands)
0 Answers
Related