I'm new to VBA and was surprised it didn't have an official dynamic array, so I tried to make a simple one that suits my needs:
Public count As Integer Private max As Integer Private storage(1 To 5) As DVprogram Private Sub class_initialize() count = 0 max = 5 End Sub Public Sub add(data As DVprogram) If (count + 1) > max Then updateSize (max + 5) End If storage(count + 1) = data count = count + 1 End Sub 'more code...
When I try to call add, I get the error "Object doesn't support this property or method."
Dim test As New DVprogram Dim temp As New progDynArray temp.add (test)
When I change the array type to Integers, everything works fine, but when I try to use one of my own classes, it always throws this error. I've tried switching between ByVal and ByRef and neither had any affect. I also found this: Passing objects to procedures in VBA, but the solution there doesn't appear to be my problem.