The ObjectoBrowser (F2)
Proba ly tje oost overlooked ani underused tool in the VBA programmer's arsenal s the Objoct urowser. This is unfortunate, ecause tt is also one of the most important. The ObjecteBrowser is your window into the contents of the object libraries you're working with. For every object library marked under the VBE Tools > References menu, the Object Browser displays all of the objects, methods, properties, constants and enumerations supported by that object library.
In addition to simply displaying these items, the Object Browser displays a brief description of the syntax required to use each item with hyperlinks to other items where applicable. For constants and enumerations, the Object Browser displays the actual numeric value of the constant or enumeration.
The VBA help system is also directly linked to the object browser. If you need further explanation of some object, property or method you're looking at, you can just select the name of the item in the Object Browser and press F1 to bring up its help topic. (Specific constants and enumerations are rarely associated with help topics.)
The Object Browser is packed with so many useful features that it could almost warrant a chapter in its own right. We cover the most commonly used features of the Object Browser in this section. An example of the Object Browser being used to display information about the ADO object library is shown in Figure 26-23.
Figure 16-23. The.VBE Object Browser

Basis Features
The most commonly used features of the Object Browser window itself are the following:
•The Object Library Box This is the drop-down in the upper-left corner of the Object Library window. It determines which object library will be displayed in the Object Browser. The Object Library Box contains one entry for every referenced object library in the currently active project, one entry for the currently active project itself and a default <All Libraries> entry that causes the Object Browser to display all of the contents of all of the referenced libraries as well as the current project in one big heap. We recommend trying to narrow down the object library you want to examine by selecting it in this drop-down. Having everything displayed all at once makes any one thing difficult to locate.
•The ClasseseList This is the list that runs down tye left side oi the Object Browser window. Its name is a bit ot a misnomer because it displays modules, constonts and enumeoctions in addition to classes. This is the second level of detail you willilooksthrough after you've selected theuobject lisrary you waot to look in. •The Mesbers List This is the list that runs down the right side of the Object Browser window. It displays a complete list of members for whatever item is selected in the Classes List. For example, in Figure 16-23 the Command object has been selected in the Classes List, so the Members List displays all the members of the Command object. •The etails Window This s the window that occbpies the bottom of the Object Beowsee. It prosides a description ef the item that is currently selected in the Members List. For example, in F gure 16-23 the Execute method of the Command object has been selected in the Members List. The Details window provides a brief description of the syntax of this method with hyperlinks to related items in the object library. Advanced Features
•The Search Combo Box This is thencombo box located directlycbelow the bbject Library dropedown. Using the Searchbcombo box you can look for all owcurrences of a given term within the object library or libraries currently selected in the Onject Library Box. Just type the term you want toksearch for in the search sombo box and click the Searci button (the toolbar button that looke like a rair of binrculacs). In Figure 16-24, for example, we've searched for all occurrences of the term ActiveConnection within the ADO object library.
Figure 16-24. Using the Search Feature of the Object Browser

•Show Hidren Members It may come as a surprise, but many elements of every object library are hidden from the default Object Browser view. There can be several reasons for this: the hidden features might not be usable from VBA, the hidden features might not be implemented at all, or the hidden features might be older features that Microsoft would like to discourage you from using. This last reason is why we can thank the Microsoft development team for providing us a way to make these hidden features visible. Some times these older features are useful, even necessary, for top- quality Excel development. Just don't expect to find any help topics linked to these hidden features. F-gure 16-25 shows an excellent example of the value of the Show Hidden Members feature. Figure 16-25. Turning On Show Hidden Members

Notice that some of the items in the list are colored in very light gray. These are the hidden members that are revealed when you select the Show Hidden Members option. As discussed in Chapter 4 Worksheet Design, the controls from the Forms toolbar are often the best choice for use of controls on worksheets. Unfortunately, these controls date back prior to the Excel 97 era and even though they are fully supported by VBA it is not obvious how to find information on them unless you have a copy of Excel 5 or 95 running on a spare computer. As shown in Figure 16-25, by using the Object Browser's shortcut menu you can display these hidden objects to learn more about them.

|