Tools Menu

One of the most powerful functionalities of the VBA environment is its capability to extend itself beyond the bounds of the host program. Two of the commands that provide this functionality, adding references to other object models and additional controls for UserForms, are found on the Tools menu. Also on the Tools menu are the following commands for customizing the editor and adding Help files, password protection, and digital signatures to your project:

References. Opens the References dialog box (see Figure 31-3), in which you make connections to external libraries, including the object models of other applications.

Libraries that are referenced by a project are indicated by the check box next to the library name. Clearing the check box of any library that you are not using in your project results in faster compilation of your project because unused object references must otherwise be verified.

Note The "Visual Basic for Applications" and "Microsoft Project 11.0 Object Library" libraries are always referenced by Microsoft Project and cannot be removed.

Procedure View

Full Module View

Procedure View

Full Module View

Figure 31-3. The References dialog box controls which objects are available to your project. Selections here determine which object models display in the object browser.

Figure 31-3. The References dialog box controls which objects are available to your project. Selections here determine which object models display in the object browser.

The Priority buttons change the order in which libraries are searched for objects. You should change the priority of a reference only if the same object name is used in more than one referenced library.

Note References are specific to each project.

Additional Controls. Opens the Additional Controls dialog box (see Figure 31-4), in which you select additional custom controls to use on your UserForms. This command is available only when creating or editing the visual elements of a UserForm.

Figure 31-4. Selections made in the Additional Controls dialog box determine which controls appear in the Toolbox window.

Note Although any control that appears in the Available Controls list can be added to the Toolbox, not all controls are authored so that they can be used outside their intended environment.

Options. Opens the Options dialog box (see Figure 31-5), in which you select visual, behavior, and other options for the editor that suit your needs or preferences.

Figure 31-5. Selecting the Require Variable Declaration check box on the Editor tab of the Options dialog box enforces explicit declaration of variables.

VBAProject Properties. Opens the Project Properties dialog box (see Figure 31-6). Don't confuse the Project Properties dialog box with the Properties window. You can use the Project Properties dialog box to modify the properties of a VBProject object, including giving it a description and connecting it to a Help file.

Figure 31-6. Specifying a password without also selecting the Lock Project For Viewing check box protects the Project Properties dialog box only.

You can prevent other people from viewing or modifying your project by clicking the Protection tab, selecting the Lock Project For Viewing check box, and then providing a password.

Tip Project information in the object browser

The project name and description also appear in the object browser, which can be especially useful when searching for specific procedures in larger projects.

Note The name of this command changes according to the name of the selected project. "VBAProject" is the default name of any new project.

Digital Signature. Displays the Digital Signature dialog box (see Figure 31-7), in which you can digitally sign a project with a certificate.

Digita L Signât u re | X |

The VBA project is currently signed as

Certificate name: Teresa Stover

Detail... 1

5ign as

Certificate name: Teresa Stover

Remove |

Choose... J

[ OK ;|


Figure 31-7. The Digital Signature dialog box for a project signed with a certificate created by using SelfCert.exe is shown here.

Digitally signing a project lets other users of your project know that it originated with the signer and has not changed since it was signed. You can use the SelfCert program, found in the Program Files\Microsoft Office\Office11 folder, to create your own certificate.

For more information about digital signatures, including how to obtain a digital certificate from a commercial Certificate Authority, search for "About digital signatures" in Microsoft Project Help.

Note In an environment in which the macro security level is set to High on all computers, a self-signed project can be deployed but cannot be run because it does not have a secure-enough certificate. You must use a certificate issued by a Certificate Authority in this situation.

Tip Deploy a project under High security

One way to deploy a project in a High security environment is to send the source code to users as text, instruct them how to paste it into the Visual Basic Editor, and then use SelfCert to certify the code using their own local certificate.

Finding the Right Help


Microsoft Project includes four different Help systems for VBA, and it might not always be

clear where the content you're reading originated. Sometimes, you might know which Help

system contains the information you need, but you might not be able to figure out how to

open that specific Help file.

To get assistance with

Do the following

General Visual Basic concepts and

Click Help, Microsoft Visual Basic Help

language reference

in the editor.

Concepts and language reference

Click a Microsoft Office-specific item in

common among Microsoft Office and

code or in the object browser and then

related programs (including Microsoft

press F1.


Members of the Microsoft Project

Click a Microsoft Project-specific item in

object model

code or in the object browser and then

press F1.


Click a UserForm, a control on a

UserForm, or an item in the Properties

window, and then press F1.


Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook

Post a comment