Microsoft Office Tutorials and References
In Depth Information
Understanding VBA Project
Understanding VBA Project
The first item in the Project Explorer (see Figure 4) is called VBAProject(Book1).
Book1 is simply the name of the Excel workbook being used in the screen
capture. When the workbook is saved, the name changes to the name and file
extension of the workbook. For example, if the workbook were saved as
MyWorkbook.xls, then the Project Explorer window would also change to
display VBAProject(MyWorkbook.xls). If multiple workbooks are open, each
one is listed in the Project Explorer alphabetically, as well as any loaded Add-
ins. For simplicity, we assume that just one workbook is open at this time.
Int
Word displays the Normal project as open in the VBE if a document is open. It
loads when Word is launched. The file name of the Normal project is
normal.dot and it is Word’s default template; it is always in use when Word is
in use, much like an Add-in.
The first item within the VBAProject is Microsoft Excel Objects. As with
Windows Explorer, any of the items with a plus (+) or a minus (–) can be
expanded or retracted by double-clicking on the name or by single-clicking the
+ or –.
These are some of the primary differences in the user interface between the five
applications:
Application
Differences
Excel
Lists every worksheet that is in the workbook within the
Microsoft Excel Objects group. ThisWorkbook is listed as well.
In the macro examples, the specialized code that can be
placed in these sections is illustrated.
Word
Lists Microsoft Word Objects where ThisDocument is listed. It
operates in a similar fashion to ThisWorkbook.
Microsoft Outlook
Lists Microsoft Outlook Objects where ThisOutlookSession is
listed. It operates in a similar fashion to ThisWorkbook, also.
Microsoft Access
Lists no Microsoft Access Objects group. There is no
ThisDatabase object.
Microsoft
PowerPoint
Does not list an Objects group. There is no ThisPresentation
object, which has long frustrated those trying to learn how to
use VBA with PowerPoint.
 
 
Search JabSto ::




Custom Search