V
vivmaha
Hi,
I'm trying to make a collection in which i place variables of a type that i
defined.
I keep getting an error message. What is the problem?
The error message:
"Compile error: Only user-defined types defined in public object modules can
be coerced to or from a cariant or passed to late-bound functions"
The code (and where the error is thrown):
Public Type myType
stuff As Integer
End Type
Sub main()
Dim box As Collection
Set box = New Collection
Dim myVar As myType
myVar.stuff = 1
box.Add myVar '<-THIS IS WHERE I GET THE ERROR
End Sub
I'm trying to make a collection in which i place variables of a type that i
defined.
I keep getting an error message. What is the problem?
The error message:
"Compile error: Only user-defined types defined in public object modules can
be coerced to or from a cariant or passed to late-bound functions"
The code (and where the error is thrown):
Public Type myType
stuff As Integer
End Type
Sub main()
Dim box As Collection
Set box = New Collection
Dim myVar As myType
myVar.stuff = 1
box.Add myVar '<-THIS IS WHERE I GET THE ERROR
End Sub