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

   

This error has the following cause and solution: