Datasheet
Macro Security
708
If you run your macro in a worksheet that already contains data in the cells
that the macro uses, you run the risk of having existing data and/or format-
ting overwritten during the macro’s execution. Keep in mind that, although
you can use the Undo feature to reverse the very last action performed by
your macro, most macros perform a series of actions, so you may end up
using multiple levels of Undo before you are able to successfully reconstruct
your spreadsheet.
Macro Security
Excel 2007 uses a system called Microsoft Authenticode that enables devel-
opers to authenticate their macro projects or add-ins created with Visual Basic
for Applications by a process referred to as
digital signing. When you run a
macro in your worksheet that’s not saved in the trusted locations on your
computer, such as the Templates and XLSTART folder in your user area on the
computer, Excel checks to see if the macro is digitally signed and that the sig-
nature is both valid and current. The macro’s developer must have a certifi-
cate issued by a reputable authority or is considered as a trusted publisher.
If the program cannot verify a macro’s digital signature (perhaps because it
doesn’t have one) or the trustworthiness of its macro publisher, the program
then displays a security alert on the message bar underneath the Excel
Ribbon. This alert area contains an Enable Content and a Trust Center com-
mand button. You can then click the Enable Content button to ignore the
alert and go ahead and run the macro, assuming that you can vouch for the
macro’s publisher and are sure that running the macro poses no security
risk to your computer. You click the Trust Center command button in the
security alert on the message bar to open the Trust Center dialog box where
you can add to the trusted locations on your computer system and change
the macro security settings.
You can also open the Macro Settings tab of the Trust Center dialog box by
clicking the Macro Security command button on the Developer tab (Alt+LAS)
or clicking the Trust Center Settings button on the Trust Center tab of the
Excel Options dialog box (Alt+FIT) and then clicking Macro Settings in the
dialog box’s Navigation pane.
By default, Excel selects the Disable All Macros with Notification option
button on the Macro Settings tab of the Trust Center. When this setting is
selected, all macros that are not saved in one of the trusted locations are
automatically disabled in the worksheet, but you do get a security alert each
time you try to run one of these macros that enables you to ignore the alert
and go ahead and run the macro by clicking the Enable Content button.
36_037385 bk08ch01.qxp 11/17/06 11:08 AM Page 708