Article ID: 129871
Article Last Modified on 12/9/2003
Debug.Print x.arr()(0)
Instead of:
Debug.Print x.arr(0)
This explicitly specifies that the variant holds an array.
Sub main()
Dim a(2) As Integer
a(0) = 5
Dim x As Object
Set x = New Class1
x.arr = a
Debug.Print x.arr(0)
End Sub
Public arr As Variant
Dim x As Object
with:
Dim x As New Class1Then change the Set statement into a comment. After making these changes, run the program again. You should see a value of 5 in the Debug Window.
Keywords: kbprogramming kbprb KB129871