the scenario:

I have made an activex control which contains a subroutine.
This subroutine has only one argument, I would like that argument to be defined as an array of longs.
much like:

Code:
Public Sub SetLengths(ByRef Lengths() as long)
looks ok doesn't it?

When I try to call this sub from a command button with the following code:

Code:
Dim MyLens(0 to 5) as long
...
...
MyControl.SetLengths MyLens
I get a type mismatch error (13)

The error is occurring before the subroutine actually comes into effect, so it is actually the calling statement which is a bit ropey somehow!

I have tried changing the way the sub is declared but I sometimes get an error saying "array / UDT expected" (not a quote btw). This is driving me nuts, can anyone tell me what is wrong.

A nice new sports car to who-ever sorts this out.