Set Macro Security

Excel controls whether workbook macros are allowed to run through security settings. Users may choose to prohibit all macros, allow only signed macros from known sources, allow macros of the user’s choosing, or allow all macros. These settings correspond to the Very High, High, Medium, and Low security settings on the Security dialog box (Figure 6-28).

How to do it

To set macro security:

  1. Open a workbook.

  2. Choose Tools Macro Security. Excel displays the macro security setting (Figure 6-28)

Choosing macro security settings

Figure 6-28. Choosing macro security settings

These settings are driven by trust—the user must choose whether or not to trust a publisher or a workbook. There is no way for the user to prohibit certain operations, such as reading or writing to the registry or erasing data files. Users only discover if their trust is misplaced after the damage is done.

For this reason, it is a good idea to encourage users to be suspicious of macros arriving in workbooks. It is a better idea to deploy macros as digitally signed templates or add-ins and to distribute those files from a secure network location.

How to distribute macros

The following scenario demonstrates how to distribute macros in a secure fashion:

  1. Set up a public network share. For example, \\Wombat1\Public\Templates.

  2. Set Windows security on the Templates folder to allow read-only access to all network users and read/write ...

Get Excel 2003 Programming: A Developer's Notebook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.