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 images References menu in the VBE. If you had done development with Office XP, the VBE should be familiar to you since the version included with Office 2003 remains the same.

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 Excel Window
Dim oWin As Window           'Gives an Excel Window

All of the applications in Office 2003 share the same development environment—the VBE. The code and forms that belong to each Excel workbook, Word document, Access database, PowerPoint presentation (i.e. the “host document”), or Access Database are ...

Get Excel 2003 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.