Hello there. I've been fiddling with Excel VBA for some time, but I never had any formal training whatsoever. I have the following piece of code on a XLSM module :
Public Type ks_solution
W As Integer
NF As String
ID As Integer
End Type
Public Sub MySub()
//does some things
MyKSSolution = MyFunction(params)
End Sub
Public Function MyFunction(params) as ks_solution
//does stuff and returns a ks_solution
End Function
When I try to run the code, VBA compiler returns a "Only user-defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions" error.
Any help would be greatly appreciated.
--Yuri