Jul 28th, 2009, 02:58 AM
[RESOLVED] [VBA / VBScript] Dictionary Object with Custom Data Type
I wasn't sure whether to post this here because I'm using VBA or in VBScript because that's where the dictionary object is being imported from.
I'm trying to use the dictionary object to be of type string, ColumnData. However, trying to add the ColumnData type to the dictionary causes the error:
"Only user defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions."
I originally had ColumnData defined as Private Type in a Private Class module. Based on the error I tried changing this to a PublicNotCreatable Class, however this gives an error. Finally I tried moving the Type to a module and defining it as Public, but that doesn't work either.
Jul 29th, 2009, 09:35 AM
Re: [VBA / VBScript] Dictionary Object with Custom Data Type
The basic answer is you can't. In the end I made a Class rather than a Data Type which worked out better anyway.
Click Here to Expand Forum to Full Width