Hi
See the code below:
[vba] Type MyType
a1 As String
a2 As Variant
End Type
Sub test()
Dim Col As Collection, Itm As MyType
Set Col = New Collection
Col.Add Itm
End Sub[/vba] I want to put custom type variables into a collection, but at the red line I get this horrible error message:
On my level of knowledge this error message is cryptic. Nevertheless I looked for solutions that I may be able to implement, but they suggest everywhere that I create a dll. Which I don't want to, because I don't know how to do it yet, and right now I think it would be too much fuss to learn it for such a small task."Only public user defined types defined in public object modules can be used as parameters or return types for public procedures of class modules or as fields of public user defined types"
I hope someone knows an easier solution? Or a workaround?
I would be very grateful for it--
Jimmy