Change macro security settings in Excel (2024)

Excel for Microsoft 365 Excel 2021 Excel 2019 Excel 2016 Excel 2013 More...Less

In Excel, you can change the macro security settings to control which macros run and under what circ*mstances when you open a workbook. For example, you might allow macros to run based on whether they are digitally signed by a trusted developer.

For more information about macro security settings in Microsoft Office documents, see Enable or disable macros in Office files.

The following list summarizes the various macro security settings. Under all settings, if antivirus software that works with Microsoft 365 is installed and the workbook contains macros, the workbook is scanned for known viruses before it is opened.

  • Disable all macros without notificationClick this option if you don't trust macros. All macros in documents and security alerts about macros are disabled. If there are documents that contain unsigned macros that you do trust, you can put those documents into a trusted location. Documents in trusted locations are allowed to run without being checked by the Trust Center security system.

  • Disable all macros with notificationThis is the default setting. Click this option if you want macros to be disabled, but you want to get security alerts if there are macros present. This way, you can choose when to enable those macros on a case by case basis.

  • Disable all macros except digitally signed macrosThis setting is the same as the Disable all macros with notification option, except that if the macro is digitally signed by a trusted publisher, the macro can run if you have already trusted the publisher. If you have not trusted the publisher, you are notified. That way, you can choose to enable those signed macros or trust the publisher. All unsigned macros are disabled without notification.

  • Enable all macros (not recommended, potentially dangerous code can run)Click this option to allow all macros to run. Using this setting makes your computer vulnerable to potentially malicious code and is not recommended.

  • Trust access to the VBA project object modelThis setting is for developers and is used to deliberately lock out or allow programmatic access to the VBA object model from any Automation client. In other words, it provides a security option for code that is written to automate an Office program and programmatically manipulate the Microsoft Visual Basic for Applications (VBA) environment and object model. This is a per user and per application setting, and denies access by default. This security option makes it more difficult for unauthorized programs to build "self-replicating" code that can harm end-user systems. For any Automation client to be able to access the VBA object model programmatically, the user running the code must explicitly grant access. To turn on access, select the check box.

Office uses Microsoft Authenticode technology to enable macro creators to digitally sign a file or a macro project. The certificate that is used to create this signature confirms that the macro or document originated from the signer, and the signature confirms that the macro or document has not been altered.

After you install your digital certificate, you can sign files and macro projects.

Obtaining a digital certificate for signing

You can obtain a digital certificate from a commercial certificate authority (CA), or from your internal security administrator or information technology (IT) professional.

To learn more about certificate authorities that offer services for Microsoft products, see the list of Microsoft Root Certificate Program Members.

Creating your own digital certificate for self-signing

You can also create your own self-signing certificate by using the Selfcert.exe tool.

Note:Because a digital certificate that you create isn't issued by a formal certificate authority, macro projects that are signed by using such a certificate are referred to as self-signed projects. Microsoft Office trusts a self-signed certificate only on a computer that has that certificate in your Personal Certificates store.

For more information about how to digitally sign a macro, see Digitally sign a macro project.

Change macro security settings

You can change macro security settings in the Trust Center, unless a system administrator in your organization has changed the default settings to prevent you from changing the settings.

  1. On the Developer tab, in the Code group, click Macro Security.

    Change macro security settings in Excel (1)

    To enable the Developer tab, see Show the Developer tab.

  2. In the Macro Settings category, under Macro Settings, click the option that you want.

    Note:Any changes that you make in the Macro Settings category in Excel apply only to Excel and do not affect any other Microsoft Office program.

You can also access the Trust Center in Excel Options. To do that, click Options (Excel 2010 to 2016 versions) or Microsoft Office Button Change macro security settings in Excel (2) (Excel 2007), and then click Trust Center > Trust Center Settings > Macro Settings.

For more information about macro security, see the following topics:

  • Add, remove, or change a trusted location

  • Add, remove, or view a trusted publisher

  • Enable or disable macros in Office files

  • Enable or disable security alerts about links and files from suspicious websites

  • View my options and settings in the Trust Center

Troubleshooting

I can’t change my macro security settings

Some users may not be able to change Trust Center settings due to group security policies in their organizations. In such cases, you need to contact the IT administrator for your organization.

What happened to the Very High, High, Medium, and Low security settings?

Excel 2003 setting

Excel 2007/2010/2013/2016 equivalent

Additional information

Very High

Disable all macros without notification

In Excel 2003, VBA macros can run only if the Trust all installed add-ins and templates option (in Excel 2003, the Trusted Publishers tab in the Security dialog box) is selected and the macros (whether signed or unsigned) are stored in a specific trusted folder on the user’s hard disk.

If not all of these conditions are met, VBA macros cannot run under the Very High security setting in Excel 2003.

High

Disable all macros except digitally signed macros

In Excel 2003, executable files (such as .exe or .com) must be signed by an acknowledged trusted source (that is, they must have a certificate of trust) in order to run. Otherwise, all executables associated with or embedded in documents are automatically disabled without warning the user when those documents are opened.

By default, all Office 2003 programs are installed with macro security set to High.

Medium

Disable all macros with notification

In Excel 2003, users are prompted to enable or disable executables when a document is opened. This level requires the acceptance of a certificate of trust for each executable, which is accepted by adding the certificate to a segment of the computer’s Windows registry.

Subsequent requests to run a macro from a trusted source are automatically accepted (the executable runs without prompting the user).

Low

Enable all macros (not recommended; potentially dangerous code can run)

In Excel 2003, all macros are run without restrictions. This security level does not protect against malicious programs, does not allow for acceptance of certificates of trust, and is not considered secure in general. This level is not recommended.

Need more help?

You can always ask an expert in the Excel Tech Communityor get support inCommunities.

Top of Page

Need more help?

Want more options?

Discover Community

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Change macro security settings in Excel (3)

Microsoft 365 subscription benefits

Change macro security settings in Excel (4)

Microsoft 365 training

Change macro security settings in Excel (5)

Microsoft security

Change macro security settings in Excel (6)

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Change macro security settings in Excel (7)

Ask the Microsoft Community

Change macro security settings in Excel (8)

Microsoft Tech Community

Change macro security settings in Excel (2024)

FAQs

Change macro security settings in Excel? ›

Click the File tab, and then click Options at the very bottom of the left bar. On the left-side pane, select Trust Center, and then click Trust Center Settings… . In the Trust Center dialog box, click Macro Settings on the left, select Enable all macros and click OK.

How do I remove security risk from Excel macros? ›

Excel 2010, 2013, 2016, 2019, and Microsoft 365:
  1. Open the File: Open the Excel file containing the blocked macros.
  2. Go to the File Tab: Click on the "File" tab in the ribbon.
  3. Open Options: ...
  4. Navigate to Trust Center: ...
  5. Open Trust Center Settings: ...
  6. Navigate to Macro Settings: ...
  7. Enable Macros: ...
  8. Click OK:
Mar 19, 2023

How to enable macro security in Excel? ›

Click the File tab, and then click Options at the very bottom of the left bar. On the left-side pane, select Trust Center, and then click Trust Center Settings… . In the Trust Center dialog box, click Macro Settings on the left, select Enable all macros and click OK.

How to stop Excel from blocking macros? ›

Please try unblocking macros. To remove block, right-click on the file, choose Properties, and then select the Unblock checkbox on the General tab.

How do I change the macro security level in Excel? ›

Change macro security settings
  1. On the Developer tab, in the Code group, click Macro Security. To enable the Developer tab, see Show the Developer tab.
  2. In the Macro Settings category, under Macro Settings, click the option that you want.

How do you change security settings in Excel? ›

Setting your macro security setting
  1. Choose Tools, Options on the Excel menu bar.
  2. Click the Security tab on the Options dialog box.
  3. Click Macro Security.
  4. Click the Security Level tab.
  5. Select either Low, Medium, or High on the Security dialog box and click OK. ...
  6. Click the Trusted Publishers tab.

How do I remove protection from a macro in Excel? ›

Right-click on the password-protected VBA project and click on VBAProject Properties… option. Switch to the Protection tab > uncheck the Lock project for viewing checkbox > click on the OK button. Finally, save .

Why are Excel macros a security risk? ›

Malicious macros can do almost anything that other malware can do to your system, including emulating ransomware, stealing data, and emailing itself out to your contacts.

How to disable security warning in Excel VBA? ›

Enable or disable security alerts on the Message Bar
  1. In an Office program, click the File tab.
  2. Click Options.
  3. Click Trust Center, and then click Trust Center Settings.
  4. Click Message Bar. The Message Bar Settings for all Office Applications dialog box appears.

How do I remove macros enabled in Excel? ›

How to Disable Macros in Excel
  1. Click the File tab > Options in Excel.
  2. Select Trust Center from the left-hand pane, and then click Trust Center Settings.
  3. Select Macro Settings from the left menu, then Disable all macros without notification and click OK.
Sep 19, 2023

How to protect macros in Excel? ›

You can first right-click on VBAProject>VBAProject Properties>Protection>insert the password you want to enable for users to run the VBA code and check Lock protect for viewing.

How do I unlock a macro in Excel? ›

how do I unlock a macro in excel?
  1. Open Windows File Explorer and go to the folder where you saved the file.
  2. Right-click the file and choose Properties from the context menu.
  3. At the bottom of the General tab, select the Unblock checkbox and select OK.
Apr 22, 2023

How to unblock security risk in Excel? ›

Select the "Unblock" checkbox on the "General" tab next to the text "This file came from another computer and might be blocked to help protect this computer." Then click “Apply”, then click “o*k”. 5. Open the spreadsheet file again and the “SECURITY RISK” message should no longer be there.

Why is Microsoft blocking my macros? ›

VBA Macro Notification Settings

This policy prevents users from being lured into enabling malicious macros. By default, Office is configured to block files that contain VBA macros and display a Trust Bar with a warning that macros are present and have been disabled.

Why are my macros not working in Excel? ›

Verify Macro Settings:

Step 1: Open Excel, go to "File," then "Options." Step 2: Access "Trust Center" > "Macro Settings." Step 3: Enable macros, restart Excel, and test.

How do I set and adjust macros? ›

To adjust your macros to lose weight, for every 0.5 lbs, if you are short of your weekly weight loss target, subtract 250 calories from your daily food intake. Reduce carbs by 40 g, and fat by 10 g — more examples of this are in the table. How should your macros be split? Protein should be set by body weight.

How do I customize macros in Excel? ›

Edit the macro

On the Developer tab, in the Code group, click Macros. In the Macro name box, click the macro that you want to edit. Click Edit.

How do I fix macro problems in Excel? ›

Step 1: Click on "File" > "Options." Step 2: Go to "Trust Center" > "Trust Center Settings." Step 3: Select "Macro Settings" and choose "Enable all macros" (not recommended for security reasons) or "Disable all macros with notification." Step 4: Click "OK" to save changes.

How do you customize a macro button in Excel? ›

Add a macro button to the Quick Access Toolbar

In the Choose commands from list, click Macros. Select the macro you want to assign a button to. Click Add to move the macro to the list of buttons on the Quick Access Toolbar. To replace the default macro icon with a different button for your macro, click Modify.

Top Articles
Latest Posts
Article information

Author: Dan Stracke

Last Updated:

Views: 5703

Rating: 4.2 / 5 (43 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Dan Stracke

Birthday: 1992-08-25

Address: 2253 Brown Springs, East Alla, OH 38634-0309

Phone: +398735162064

Job: Investor Government Associate

Hobby: Shopping, LARPing, Scrapbooking, Surfing, Slacklining, Dance, Glassblowing

Introduction: My name is Dan Stracke, I am a homely, gleaming, glamorous, inquisitive, homely, gorgeous, light person who loves writing and wants to share my knowledge and understanding with you.