I am trying to define an array of object from a function but I always get the Compile error Can't assign to array.
Here is my code:
Dim param1 As String
Dim param2 As String
Dim my_legs(1 To 4) As MyObject_Obj
Set my_legs = legBuilder(param1,param2)
private Function legbuilder (ByVal param1 As String,ByVal param2 As String)As MyObject_Obj
Dim my_legs(1 To 4) As MyObject_Obj
---Filling my Array---
legBuilder = my_legs
End Function
It seems that my function is, by design not returning the expected type (an Array of MyObject_Obj)
Am I doing it wrong?