Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Cannot Enable Macros: How to Fix the Issue

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

If Excel cannot enable macros, it is usually because the file is blocked by Microsoft's security settings for files originating from the internet or the Trust Center settings are too restrictive. To fix this, you must right-click the file in File Explorer and select Unblock in the Properties menu, or adjust the Macro settings in the Trust Center. Note that menu labels may differ slightly depending on your version of Office or your operating system region.

What You'll Need

  • A computer with Microsoft Excel installed.
  • The specific Excel file (.xlsm, .xlsb, or .xls) that contains the macros.
  • Administrative permissions to change file properties on your device.

Step-by-Step

  1. Unblock the File via Properties

    Microsoft often blocks macros in files downloaded from the web or received via email as a security measure. This is the most common reason the "Enable Content" button does not appear or does not work.

    • Close the Excel file if it is currently open.
    • Locate the file in your Windows File Explorer.
    • Right-click the file and select Properties.
    • In the General tab, look for a section at the bottom called Security.
    • Check the box next to Unblock.
    • Click Apply and then OK.
    • Reopen the file and try to enable the macros.
  2. Adjust Trust Center Macro Settings

    If the file is not blocked but macros still won't run, your global Excel settings may be preventing them.

    • Open Excel and click on the File tab.
    • Select Options from the bottom of the left-hand menu.
    • Click on Trust Center in the left sidebar.
    • Click the Trust Center Settings button.
    • Select Macro Settings from the left menu.
    • Choose Disable VBA macros with notification. This is the recommended setting because it allows you to choose whether to run macros on a case-by-case basis via a yellow message bar.
    • Click OK and restart Excel.
  3. Add a Trusted Location

    If you have a folder where you store many macro-enabled files, you can tell Excel to trust the entire folder so you don't have to unblock every individual file.

    • Go to File > Options > Trust Center > Trust Center Settings.
    • Select Trusted Locations from the left menu.
    • Click Add new location.
    • Browse to the folder where your files are stored and click OK.
    • Check the box Subfolders of this location are also trusted if applicable.
    • Click OK.

Common Mistakes

  • Saving as .xlsx: A common error is saving a macro-enabled workbook as a standard .xlsx file. Standard workbooks cannot store macros; they must be saved as .xlsm (Excel Macro-Enabled Workbook) or .xlsb (Excel Binary Workbook). If you save a macro file as .xlsx, the macros are permanently deleted.
  • Ignoring the Security Warning: Some users expect macros to run automatically. By default, Excel requires you to click "Enable Content" in the yellow bar at the top of the sheet before the code will execute.
  • Overly Permissive Settings: Enabling "Enable all macros" (not recommended) can expose your computer to malicious code. Always use "Disable VBA macros with notification" instead.

Tips

  • Digital Signatures: If you are distributing a file to others, digitally signing your VBA project allows users to trust the file more easily without manually unblocking it.
  • Check File Extensions: Always ensure the file extension is .xlsm. If you see .xlsx, the macros are gone and cannot be recovered unless you have a backup.
  • Use Trusted Locations: For business workflows, creating a dedicated "Macros" folder and adding it to Trusted Locations is the most efficient way to avoid repetitive security prompts.

Troubleshooting

If the steps above do not resolve the issue, try these checks in order:

  1. Check for Group Policy Restrictions: If you are using a work computer, your IT department may have disabled macros via a Group Policy. If the Macro Settings in the Trust Center are greyed out or cannot be changed, you must contact your system administrator.
  2. Verify VBA Installation: Ensure that "Visual Basic for Applications" was installed with your Office suite. If the VBA editor (Alt + F11) does not open, you may need to repair your Office installation via the Control Panel.
  3. Restart the Application: Sometimes the security flag is not cleared until the application is fully closed and restarted.
  4. Test with a New File: Create a simple macro in a new workbook and save it as .xlsm. If this works, the problem is specific to the original file and not your Excel installation.

Frequently Asked Questions

Why does Excel say "Security Risk: Microsoft has blocked macros from running because the source of this file is untrusted"?

This happens because the file was downloaded from the internet or an email. Microsoft added this "Mark of the Web" security feature to prevent malicious code from running automatically. You must unblock the file in the file's Properties menu to fix this.

Can I enable macros in the Excel mobile app or Excel Online?

No, VBA macros are not supported in Excel for the web or the mobile apps. They only run in the desktop version of Excel for Windows and macOS.

Is it safe to enable macros from an unknown source?

No. Macros can contain malicious scripts that can delete files, steal data, or install malware. Only enable macros in files created by people or organizations you trust.

What is the difference between .xlsx and .xlsm?

An .xlsx file is a standard spreadsheet that cannot contain macros. An .xlsm file is specifically designed to store and run VBA macros.

Does unblocking a file make it permanently safe?

Unblocking a file tells Windows that you trust that specific file. It does not "scan" the file for viruses. You should still ensure the file is from a reputable source before unblocking it.