Make sure you're passing a variant array, not a Range object. The function accepts a variant
data type, which can be anything. In order to ensure it's an array, pass the .Value
Sub Test()
Debug.Print myFunc(Range("A1:A50").Value)
End Sub
Function myFunc(MyArray As Variant)
myFunc = UBound(MyArray, 1)
End Function