Configuring Macro Security Settings
With macro viruses becoming an increasing threat, working with VBA projects can be difficult. This is true even if you just want to run your own VBA projects, because Office 2007 disables macros in documents that aren't in a trusted location. You have three ways to work around this problem:
- Store your macro-enabled documents in a trusted location. Office allows those documents' macros to run, while disabling macros in every other document.
- Enable all macros in all documents. This ensures that you can run your own macros, but it also leaves you open to viruses in third-party documents.
- Create a personal security certificate and use it to digitally sign your VBA projects.
For the last of these options, see the next section to learn how to create a personal security certificate. For the first two options, the next two sections show you how to configure the Office 2007 macro security settings.
Setting Up a Trusted Location
The easiest way to ensure that you can run your own VBA projects without also leaving yourself open to malware in third-party documents is to set up one or more trusted locations and use them to store your macro-enabled documents. Office comes with several predefined trusted locations for documents such as templates and add-ins, but none of them are easy to find. A better idea is to set up a location such as your user profile's Documents (or My Documents in Windows XP) folder or one of its subfolders. Here are the steps to follow to set up a folder as a trusted location:
- In an Office application, choose Office Application Options, where Application is the name of the program you're working with.
- Click Trust Center.
- Click Trust Center Settings to open the Trust Center dialog box.
- Click Trusted Locations.
- Click Add New Location to open the Microsoft Office Trusted Location dialog box.
- Use the Path text box to type the folder path, or click Browse to use the Browse dialog box to select the folder.
- If you want the folder's subfolders to also be trusted locations, click to activate the Subfolders of This Location Are Also Trusted check box.
- Click OK.
- Repeat steps 5 through 8 to add more trusted locations.
- Click OK to return to the Options dialog box.
- Click OK.
- Repeat steps 1 through 11 for any other Office applications that you use to create VBA projects.
Caution: After you set up a folder as a trusted location, keep it secure by using it to store only macro-enabled documents that you know are safe. In most cases, you should use the trusted location to store only your own VBA projects and macro-enabled documents that you've scanned with anti-virus software.
With your trusted locations in place, you should now ensure that each Office application is set up to disable all macros except those in documents that reside in trusted locations. The next section tells you how to do this.