What is the syntax for passing arrays to functions?
In other words, for the following simple test example, what would work? It is highlighting the asValue parameter and saying, "Type mismatch: array or user-defined type expected". This occurs whether or not I follow it with the empty parentheses.
I want the function to be able to accept an array of any type, hence the "As Variant" type in the definition despite the call being made with an array of strings.![]()
Function ArrayCall(ByRef A() As Variant) As Boolean ArrayCall = True End Function Sub TestArrayCall() Dim asValue(2) As String Call ArrayCall(asValue()) End Sub
Bookmarks