Class Objects
Finally, we’re ready to create COM classes with Visual Basic. Perhaps you don’t care for the Stories, Inc., approach, or maybe it’s just overkill for your project. To create the CYarn class, insert a class module into your project and name it CYarn. Add the methods and properties you need and use it the obvious way:
Dim yarn As CYarn
Set yarn = New CYarn
yarn.Spin “That wanders away from the truth”
You can use CYarn as a local class inside the same project, or turn it into an EXE or DLL server. If you like, you can wrap the whole package up as an ActiveX control with property pages and a Toolbox button. These are all manifestations of the same concept: an object whose properties and methods are referenced through an object variable.