Chapter 9. Object Models
In this chapter, we present a general overview of object models and the syntax used to manipulate them in code.
As we have discussed, VBA is the programming language that underlies several important Windows applications, including Microsoft Excel, Word, Access, PowerPoint, Visual Basic, and, in Office 2000, Outlook. Any application that uses VBA in this way is called a host application . We also discussed the fact that each host application enhances VBA by providing an object model (perhaps more than one) to deal with the objects that are particular to that application.
Microsoft provides over a dozen different object models for its Office application suite and related products. These include object models for Excel, Word, Access, DAO (Data Access Objects), Outlook, PowerPoint, Binder, Graph, Forms, VBA, VB, ASP (Active Server Pages), and more. Of course, our interest in this book is with the Excel object model, and we will devote most of the rest of the book to describing the major portions of this model. (We will also discuss a portion of the Office object model in the chapter on customizing Excel menus and toolbars.)
Objects, Properties, and Methods
In the parlance of VBA programming, an object is something that is identified by its properties and its methods. For example, workbooks, worksheets, charts, and fonts are all examples of objects in the Excel object model. Actually, the Excel object model contains 192 different objects, including several hidden ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access