Читать книгу Excel 2019 Power Programming with VBA - Michael Alexander, Dick Kusleika - Страница 128

Use the Object Browser

Оглавление

The Object Browser is a handy tool that lists every property and method available for every object. When you are in the VBE, you can bring up Object Browser in any of the following three ways:

 Press F2.

 Choose View ➪ Object Browser.

 Click the Object Browser button on the Standard toolbar.

The Object Browser is shown in Figure 2.17.


FIGURE 2.17 The Object Browser is a great reference source.

The drop-down list in the upper-left corner of Object Browser includes a list of all object libraries to which you have access:

 Excel itself

 MSForms (if user forms are utilized in your workbook)

 Office (objects common to all Microsoft Office applications)

 Stdole (OLE automation objects)

 VBA

 The current project (the project that's selected in Project Explorer) and any workbooks referenced by that project

Your selection in this upper-left drop-down list determines what is displayed in the Classes window, and your selection in the Classes window determines what is visible in the Members Of panel.

After you select a library, you can search for a particular text string to get a list of properties and methods that contain the text. You do so by entering the text in the second drop-down list and then clicking the binoculars (Search) icon.

1 Select the library of interest.If you're not sure which object library is appropriate, you can select <All Libraries>.

2 Enter the object you're seeking in the drop-down list below the library list.

3 Click the binoculars icon to begin the text search.

The Search Results window displays the matching text. Select an object to display its classes in the Classes window. Select a class to display its members (properties, methods, and constants). Pay attention to the bottom pane, which shows more information about the object. You can press F1 to go directly to the appropriate help topic.

Object Browser may seem complex at first, but its usefulness to you will increase over time.

Excel 2019 Power Programming with VBA

Подняться наверх