O'Reilly logo

Excel® 2007 VBA Programmer's Reference by Michael Alexander, Rob Bovey, Stephen Bullen, John Green

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. VBE Object Model

Officially known as "Microsoft Visual Basic for Applications Extensibility 5.3," the VBE object library provides access to the code and forms within an application, and to the various objects that compose the Visual Basic Integrated Development Environment (VBIDE). By default, this object library is not included in the list of referenced libraries for new projects. In order to use the objects referred to in this chapter, a reference to the Microsoft Visual Basic for Applications Extensibility 5.3 library must be created using the Tools

VBE Object Model

Many of the objects in the VBE object model have the same names as objects in the Excel object model. To distinguish the libraries and to ensure that you have the object from the VBE library, you need to include the VBIDE library name in any Dim statements you may use:

Dim oWinVB As VBIDE.Window      'Always gives a VBE Window
Dim oWinXL As Excel.Window      'Always gives an XL Window
Dim oWin As Window              'Gives an XL Window

All of the applications in Office 2007 share the same development environment — the VBE. The code and forms that belong to each Excel workbook, Word document, Access database, or PowerPoint presentation (that is, the "host document") are grouped into Visual Basic projects (the VBProject object). There is one project for each host document. Outlook has a single Project, which "belongs" to the application.

Links between ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required