I have a function that returns a string array
Function getAr() As String
Dim tmpAr(3) As String
getAr(0) = "Hallo"
getAr(1) = "I"
getAr(2) = "Am"
getAr(3) = "I"
getAr = tmpAr
End Function
In a Sub I want to reassign the returned string array like
Sub test()
Dim tmpAr() As String
ReDim tmpAr(UBound(getAr))
Debug.Print tmpAr(0)
Debug.Print tmpAr(1)
End Sub
The error is
assigning to data field is not possible.
I guess that is because I have to dimension the strAr to the same dimension as the myfunc arry. But I just do not get that information.
Could anyone help me here?