I want to write a generic function to convert between arbitrary types, for example:
Code:
TheValue = CType(obj, MyClass)

TheValue2 = CType(obj, MyClass2)
The parameters of the function are as follows:
Code:
Public Function CType(ByVal Value As Variant, DestType As TypeOrClassName) As Variant

End Function
I'd like to hear everyone's advice. Thanks.