Hello,

Using the following code, I am defining a function that will output an array as result. For some reason it is not working and not able figure this out.
Function values(c As Integer, a As Integer) As Variant()
Dim cr As Variant
cr = Array(0, 0, 0, 0, 0, 0)
cr(0) = c + a
cr(1) = 4 * a
cr(5) = 7 + a


values = cr
End Function

Sub get_io()
Dim val As Variant
val = values(9, 8)

End Sub
After executing get_io sub, the varaiable val is empty? It should have the values calculted from the function?

Thanks,
Leyo Joseph