Macro Security Settings in Excel

In this article, you’ll get to know about Macro Security and all the security options available in Excel.

Macro Security Settings in Excel

The macros created in Excel are written in the programming language VBA (Visual Basic for Applications).

There will be a threat of viruses when there is an executable code and so macros are also susceptible to viruses.

What are Macro Viruses and Security?

Macros in Excel VBA has access to most of the Windows system calls and executes automatically when workbooks are opened. Viruses in Excel macros can be very dangerous to your computer in many ways

You can identify which macros you can trust and which you cannot by using the macro security settings.

The important Excel macro security feature is the file extensions.

By default, Excel workbooks are saved with a .xlsx file extension. You can trust workbooks with .xlsx, as they are not capable of storing a macro and will not carry any threat.

Excel workbooks with macros are saved with .xlsm file extension. They are Macro Enabled Excel Workbooks. You must make sure that the macros they contain are not malicious before you open such workbooks.

You can trust a macro-enabled workbook by doing the following

  • Checking if a macro is digitally signed
  • Placing the macro-enabled workbooks in a trusted folder
  • Enabling security alert messages for opening macro-enabled workbooks

You can make use of these three options from the Trust Center in the Excel Options.

Macro Security Settings in Trust Center

You can find the macro settings in the Trust Center in the Excel Options. To access the Trust Center, do the following −

  • Click on the FILE tab on the Ribbon.
  • Click Options. The Excel Options dialog box appears.
Macro Security Settings in Trust Center
  • Select the Trust Center in the left pane.
  • Click the Trust Center Settings button under Microsoft Excel Trust Center.
Macro Security Settings in Trust Center

The Trust Center dialog box opens up.

Macro Settings

You can select Macro settings from the left pane in the Trust Center.

Macro Settings

In Macro Settings, four options are available.

  • Disable all macros without notification − Macros and security alerts about macros are disabled.
  • Disable all macros with notification − Macros are disabled and if there are macros present then security alerts appear.
  • Disable all macros except digitally signed macros − If the macro is digitally signed by a trusted publisher, and if you trust the publisher the macro runs. If you do not trust the publisher, you will be notified to trust the publisher and enable the signed macro.
  • Enable all macros (not recommended, susceptible to macro viruses) − All macros run. This makes your computer vulnerable to potentially malicious code.
  • Trust access to the VBA project object model– By selecting this, you give programmatic access to the Visual Basic Applications (VBA) object model from an automation client.

Trusted Locations

If a macro-enabled workbook is from a reliable source, then better move the file to the trusted location identified by Excel.

Click the Trusted Locations from the left pane in the Trust Center dialog box. The Trusted Locations set by Microsoft Office appear on the right side.

Trusted Locations

You can add new, remove and modify the existing locations, but ensure that the location is secure.

Trusted Publishers 

These are Digitally Signed Macros from Reliable Sources. Even if a macro is digitally signed, you need to ensure that it is from a trusted publisher.

You can find the trusted publishers in the Trust Center.

  • Click Trusted Publishers in the Trust Center dialog box. A list appears on the right side with the details – Issued To, Issued By and Expiration Date.
  • Select a certificate and click View.
Trusted Publishers

The information about the certificate displays.

Message Bar

When there are macros in the file that you are opening, the Message Bar displays security alerts.

If you think that the macros are from a reliable source, you can click on the Enable Content button on the Message Bar.

You can click the Message bar option from the left pane in the trust center dialog box.

Message Bar
  • Show the Message Bar in all applications when active content such as macros is blocked.

 The Message Bar appears when potentially unsafe content has been disabled.

If you have selected – Disable all macros without notification in the Macro Settings of the Trust Center, then this option is not selected and the Message Bar does not appear.

  • Never show information about blocked content.

This disables the Message Bar and alerts do not appear about security issues.