- VBA Automation for Excel 2019 Cookbook
- Mike Van Niekerk
- 359字
- 2021-06-11 18:16:33
Using the Object Browser in the VBA Editor
This recipe covers usage of the Object Browser in the VBA Editor. The name says it all; the Object Browser lets you browse through the objects available to you.
In later recipes, we will look into the autocompletion of our code. For instance, when you type the name of an object in the code window and type a dot, a context menu appears with a list of actions you can choose from:

Figure 3.9 – The context menu with available library options
The green icons are methods, including cutting, pasting, and clearing contents. The other icons are properties. You can, in other words, choose methods or properties here, or use the Object Browser, as described hereafter.
Getting ready
Make sure that a blank workbook is active in Excel.
How to do it…
- Activate the VBA Editor by pressing Alt + F11.
- With the Editor active, press F2 to activate the Object Browser. You can also do this by clicking on View | Object Browser:
Figure 3.10 – The Object Browser
- The drop-down list in the top left-hand corner, just under the title bar, contains a list of all the object libraries that are currently available. Figure 3.10 displays the Excel libraries.
- Just below that, a second drop-down list lets you enter a search string. In this example, I searched for all Excel objects that deal with open.
- The object library now displays everything that contains the text open. If you want to know more about Close, for instance, click on that object and press F1 for more information.
- There is also the Auto List Members feature. It provides a list of properties and methods as you type. Figure 3.11 shows an example of this for the worksheets collection:

Figure 3.11 – The Auto List Members option
How it works…
The Object Browser is a tool in the VBA Editor that lets you browse through the objects available to you.
The Auto List Members feature provides a list of properties and methods as you type. It eliminates some typing, and also ensures that the property or method is spelled correctly.
- DB2 V9權(quán)威指南
- Embedded Linux Projects Using Yocto Project Cookbook
- R語(yǔ)言數(shù)據(jù)可視化實(shí)戰(zhàn)
- 云計(jì)算通俗講義(第3版)
- 21天學(xué)通C++(第6版)
- Quarkus實(shí)踐指南:構(gòu)建新一代的Kubernetes原生Java微服務(wù)
- HTML 5與CSS 3權(quán)威指南(第3版·上冊(cè))
- Programming with CodeIgniterMVC
- 大話Java:程序設(shè)計(jì)從入門到精通
- Beginning C++ Game Programming
- Python編程:從入門到實(shí)踐(第3版)
- C++程序設(shè)計(jì)教程(第2版)
- 零基礎(chǔ)輕松學(xué)C++:青少年趣味編程(全彩版)
- 零基礎(chǔ)PHP從入門到精通
- C語(yǔ)言開(kāi)發(fā)寶典