Here’s the error message: [indent]
Only user defined types
defined in public object modules
can be coerced to or from a variant
or passed to late-bound functions
[/indent]User defined type – i know what that is
public object module – not sure. How is this different from a Module or a Class module?
coercion – yeah, that’s what i guess i need
Here’s some code i was playing with in a Plain Ol’ Module to try to figure this out:
Option Explicit Public Type udt ' user defined type i As Integer End Type Dim x As udt Dim anx As Variant Public Function CreateX(i As Integer) As Variant x.i = i ' CreateX = CVar(x) <<< doesnt work ' CreateX = x <<< doesnt work End Function Public Sub test() ' anx = CreateX(42) <<< doesnt work CreateX (42) anx = x End Sub
A clue! A clue! A reference to a text will do!
My kingdom for a clew, already!