Summary
You use class modules to create objects and their associated methods, properties, and events. You can collect child objects in a parent object so that you can create a hierarchy of objects to form an object model. You can use class modules to trap the events raised by other objects including the Excel application. You can also define and raise your own events in a class module.
When you set up cross-references between parent and child objects so that each is aware of the other you create a structure that is not simple to remove from memory when it is no longer useful. You need to add extra code to remove these cross-references.
Class modules are a powerful addition to a developer's toolkit. The objects created lead to code that is easier to write, develop, maintain, and share than traditional code. Objects are easy to use because they encapsulate complex code in a form that is accessible. All you need to know to use an object are its methods, properties, and events. Objects can be shared because the class modules that define them are encapsulated (self-contained) and therefore transportable from one project to another. All you need to do is copy the class module to make the object available in another project.
As a developer you can easily add new methods, properties, and events to an object without changing the existing interface. Your objects can evolve without harming older systems that use them. Most developers find class modules addictive. The more you use them, the more you like them and the more uses you find for them. They are used extensively throughout the rest of this book.