|
Convert UDT to Class Module
Converting a User Defined Type to a Class Module
User Defined Types (UDTs) have been around for a long time. Long before the concept of Objects were introduced. They're still indispensable in specific situations... mostly for use with Windows APIs, or when raw speed is an issue. The problem is that they have too many restrictions placed on them for use in Public methods or properties. They can also be very stubborn when you want to create collections of UDTs.If you attempt to use them incorrectly, you'll get the infamous "Only public user defined type defined in public object modules can be used as return types for public procedures of class modules or as fields of public user defined types." error message even though the code looks like perfectly formatted code that follows all syntax rules.
Click here to see problematic UDT usage sample.
Click here to see an "Easy as pie" converted UDT sample
|