Hi, I have created a user type:
Private Type SampleInfo
SampleCode As String
SampleID As Long
SampleType As String
ProductType As String
End Type
Dim Info as Type
When I try to put Info into a collection object
Dim colInfo As New Collection
colInfo.Add Info
I get the following error returned:
"Compile error:
Only user defined types in public object modules can be coerced to or from a variant or passed to late bound function"
Am I trying to do the impossible? Any help appreciated.
By the way I have tried defining the type as a Public Type with no success.
Private Type SampleInfo
SampleCode As String
SampleID As Long
SampleType As String
ProductType As String
End Type
Dim Info as Type
When I try to put Info into a collection object
Dim colInfo As New Collection
colInfo.Add Info
I get the following error returned:
"Compile error:
Only user defined types in public object modules can be coerced to or from a variant or passed to late bound function"
Am I trying to do the impossible? Any help appreciated.
By the way I have tried defining the type as a Public Type with no success.