J
Jon Furman
I just ran into a strange annoyance, I wanted to add a variable that was
declared as a UDT to a collection and received the following compilation
error:
"Only user-defined types defined in public object modules can be coerced to
or from a variant or passed to late-bound functions"
Now my type definition is declared public in a separate module and the
variable I'm using to add to the collection is Dim'd as the UDT type.
Everything works fine all up to the statement where I add the UDT variable
to the collection. I checked the documentation on collections and it states
that they can contain variables of ANY data type. So I'm not sure what's
going on here. I guess I could wrap the UDT in a class module but that's a
big pain for something so simple. Any one else seen this? Am I missing
something or is this a known VBA deficiency?
Thanks All!
Jon
declared as a UDT to a collection and received the following compilation
error:
"Only user-defined types defined in public object modules can be coerced to
or from a variant or passed to late-bound functions"
Now my type definition is declared public in a separate module and the
variable I'm using to add to the collection is Dim'd as the UDT type.
Everything works fine all up to the statement where I add the UDT variable
to the collection. I checked the documentation on collections and it states
that they can contain variables of ANY data type. So I'm not sure what's
going on here. I guess I could wrap the UDT in a class module but that's a
big pain for something so simple. Any one else seen this? Am I missing
something or is this a known VBA deficiency?
Thanks All!
Jon