Microsoft Office Tutorials and References
In Depth Information
Using the Object Browser
using THE oBjEcT BroWsEr
The VBE offers a useful tool you should know about, called the Object Browser. This section gives
some background on the Object Browser and how you can use it to familiarize yourself with
locating objects and their associated properties and methods.
The ability to program Excel is based on tapping into any of several libraries of objects in the
Microsoft Office objects model. For example, there is an Office library, a VBA library, and of
course, an Excel library. Some libraries have hundreds of objects, and each object has many
properties, methods, and in some cases, associated events. The interwoven collection of object libraries
and their keyword kin is enormous. Fortunately, there is the Object Browser to guide your search
for information about objects and their properties for whatever library you are interested in.
To see the Object Browser in the VBE, press the F2 key or click View ➪ Object Browser. It will look
similar to Figure 3-4 — it covers the area normally occupied by the Code window.
List of all Classes available for
Excel that you can select to browse.
This pane lists all Properties and Methods
that apply to whichever Class item you select.
To get a feel for the Object Browser, click the drop-down arrow next to <All Libraries> and select
Excel. When you do that, in the Classes pane, you will see the classes belonging to Excel. Click the
Application class and you will see the larger Members pane display the properties and methods
relating to the Application object. Click the ActiveWorkbook member and look at the bottom of
the Object Browser. You see that ActiveWorkbook is a property that itself is a Workbook object.