SECTION 3
Lesson 3.4: Excel Security

   

 

 

It is well known that VBA macros can be a source or carrier of computer viruses. Because of this, you should never use a macro if you do not know where it came from, and you should never open a document that contains a macro unless you trust the source of the document.

 

If you choose Tools->Options from the menu bar, and click the security tab, you will see a Macro Security button in the lower right of the Options dialogue box. If you click on the Macro Security button, you will display a Security box detailing four levels of macro security.

 

 

You can specify low security, which will basically permit Excel to run any macro no matter where it comes from.

 

You can specify Medium security, which will make Excel prompt you as to whether or not you want to run or disable macros if the workbook you open contains a macro.

 

This is the medium level security warning for macros.

 

You can also specify a High level of macro security, in which case only digitally signed macros from trusted sources, will be allowed to run.

 

Finally, you can specify a Very High level of security that will only let macros stored in trusted locations (like your computer) run.

 

To set the macro security level, select the radio button corresponding to the level of security that you want, and click the OK button.

 

To digitally sign a macro, choose Tools->Macro->Visual Basic Editor from the menu bar.

 

In the Visual Basic Editor Toolbar, click the Project Explorer button.

 

Then, select the VBA Project/Worksheet with the macro you want to sign and choose Tools->Digital signature.

 

 

This will display a Digital Signature dialogue box.

 

 

Click the Choose button to display a list off available certificates.

 

 

When you are finished, click the OK button.