Illegal use of function

You defined a function as a member of a class and specified its return type as something other than Variant or object reference. You then referred to that function as though its return type were an object reference or a Variant holding an array, list, or object reference. For example:

Class MyClass
  Function MyFunction(X As Integer) As Integer
  '...
  End Function
End Class
Dim varV As Variant
Set varV = New MyClass
Print varV.MyFunction.F(1)			' Illegal.
Print varV.MyFunction.Something		' Illegal.

Remove the reference or change the function's return type to Variant.