4.1. VBA Objects

You can't program in VBA without understanding how the various components of VBA work together. All VBA code is comprised of individual statements. Those statements take objects and manipulate their properties, call their methods, and perform their events. This section will introduce the concepts of objects, properties, methods, and events.

4.1.1. Objects

VBA is an object-oriented programming (OOP) language. OOP is a type of programming in which programmers define a complete data structure, from data types to the operations that can be applied to the data structure. Programmers can create an entire object that contains both data and the operations that the object can perform. Programmers can also create relationships between objects

There are a lot of objects you can access in VBA. The collection of objects exposed by a particular application is called an object library. There are many different object libraries you can access in VBA. For example, you can use VBA to manipulate the Access object library and work with objects such as tables, queries, forms, and reports. You can set references (which we'll cover in the next chapter) to other object libraries such as Microsoft Outlook, Adobe Acrobat, or Microsoft Word. Every time you set a reference to another application's object library, you have access to all of the objects within that library. An object is generally thought of as a physical thing. Let's say you're setting a reference to a car's object library. ...

Get Access 2003 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.