Search notes:

VB Editor Object Model: VBProject

The VBProject object represents a VBA project.

Properties and methods

buildFileName
collection
description
fileName
helpContextID
helpFile
makeCompiledFile()
mode
name
protection
references A collection of reference objects.
saveAs()
saved
type
vbComponents
VBE

Relationship to Office documents

There is usually (always?) a one to one relationship between an Office file (or document such as a word document or an Excel workbook) and its corresponding vbProject object.
For example, the vbProject of a workbook can be found with an expression like
? activeWorkbook.vbproject.name

Container for code and forms

A vbProject object is a container for all VBA code and forms within the Office document that stores it. These items are referred to as «components» and might be referenced with an expression like
? activeWorkbook.vbproject.vbComponents

Adding references to a VBA project

A VBA project can use the functionality of another VBA project by adding a reference to the project from which it wants to import the desired functionality.

See also

Example: iterating over projects
The VB Editor object model
VBA project

Links

docs.microsoft.com: Visual Basic Add-in Model reference
C. Pearson: Programming the VBA Editor

Index