O'Reilly logo

Professional Excel Development: The Definitive Guide to Developing Applications Using Microsoft® Excel and VBA® by John Green, Rob Bovey, Stephen Bullen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Using Class Modules to Create Objects

Class modules are used to create objects. There are many reasons for you as a developer to create your own objects, including the following:

  • To encapsulate VBA and Windows API code to make it transportable and easy to use and reuse, as shown in Chapter 9 — Understanding and Using Windows API Calls

  • To trap events

  • To raise events

  • To create your own objects and object models

In this chapter we assume you are already familiar with writing VBA code to manipulate the objects in Excel and are familiar with the Excel object model that defines the relationships among those objects. We also assume you are familiar with object properties, methods and events. If you have written code in the ThisWorkbook module, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required