Share via

Why aren't macros being enabled after enabling them?

David Dietz 0 Reputation points
2026-06-10T17:44:29.8166667+00:00

I am following the directions to enable macros yet they're still unable to be used.

Microsoft 365 and Office | Excel | For home | Windows
0 comments No comments

3 answers

Sort by: Most helpful
  1. myall_blues 0 Reputation points
    2026-06-13T04:19:02.7166667+00:00

    Another possibility, if you downloaded the file from somewhere, is that it has been blocked.

    In file explorer, right click on the file and select properties.

    On the general tab, at the bottom, check the 'Unblock' checkbox next to the security heading.

    User's image

    Regards

    Murray

    Was this answer helpful?

    0 comments No comments

  2. Kai-H 19,130 Reputation points Microsoft External Staff Moderator
    2026-06-11T08:53:59.57+00:00

    Hi, David Dietz

    Macro settings are only one part of the problem. If the workbook is in the wrong format, opened in the web version, or the macro is stored somewhere else, Excel can look “enabled” but still have no usable macro to run.

    Besides the solutions provided by the Q&A Assist, here are some suggestions you can try:

    First, check the file type. If the file ends in .xlsx, macros will not run from it. Open the file in Excel desktop, choose File > Save As, and save it as Excel Macro-Enabled Workbook (*.xlsm). If the file was already saved as .xlsx after the macro was created, the macro code may have been removed, so you may need an older copy of the file.

    Also make sure you are not using Excel for the web. Excel online can open .xlsm files, but VBA macros do not run there. Use Open in Desktop App and test it again.

    If the macro was created on another computer, it may have been saved in that person’s Personal Macro Workbook instead of inside the file. In Excel desktop, press Alt + F11 and check whether the workbook actually contains modules/code. If there is no code in that workbook, ask the sender to resend the real .xlsm file with the macro included.

    It is also recommended that you test the macro from Developer > Macros instead of using a button. If it runs from there, the button may simply be linked to the wrong macro name. If it does not run, open the VBA editor and use Debug > Compile VBAProject to check whether the macro has an error or missing reference.

    Thank you for your patience in reading, I hope this information has been helpful to you. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment."    

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 

    Was this answer helpful?

    0 comments No comments

  3. AI answer

    2026-06-10T17:44:46.2766667+00:00

    Several additional settings can prevent macros from running even after they’ve been “enabled.” In Excel for Microsoft 365 on Windows, check the following areas step by step.

    1. Confirm macro settings in Trust Center
      1. In Excel, select File > Options > Trust Center > Trust Center Settings.
      2. Select Macro Settings and ensure one of these is selected:
        • Disable VBA macros with notification (recommended), or
        • Enable all macros (not recommended; potentially dangerous code can run).
      3. If using Excel 4.0 (XLM) macros, also check the box Enable Excel 4.0 macros when VBA macros are enabled.
    2. Check Excel 4.0 (XLM) macro controls If the workbook uses old Excel 4.0 macro sheets (XLM):
      • In Trust Center > Trust Center Settings > Macro Settings, make sure Enable Excel 4.0 macros when VBA macros are enabled is checked.
      • If a Group Policy or registry setting is blocking XLM macros, Excel 4.0 macros may still not run. For example, the policy Prevent Excel from running XLM macros or the registry value HKCU\SOFTWARE\Microsoft\Office\16.0\Excel\Security\XL4MacroOff = 1 will disable them.
      • Organizations can instead use the Macro Notification Settings policy and clear Enable Excel 4.0 macros when VBA macros are enabled to only block XLM macros in untrusted workbooks.
    3. Verify the file’s trust status and source Even with macros enabled, Office can still block them based on file origin:
      • Files from the internet or untrusted locations can have macros blocked by default. Office will show a Trust Bar and may display messages such as “macros have been disabled” or “macros from the internet are blocked.”
      • To allow macros, use Enable Content on the Trust Bar so the file becomes a Trusted Document.
      • If the file is on a network share, ensure it is in a trusted location or that your organization’s macro policies allow macros from that location.
    4. Check for ActiveX or add-in–related blocking If the macro relies on ActiveX controls or add-ins:
      • In File > Options > Trust Center > Trust Center Settings > ActiveX Settings, ensure Disable all controls without notification is not selected; otherwise, controls and related macro functionality may not appear or run.
      • Some add-ins (for example, Solver, Analysis ToolPak) rely on Excel 4.0 macros and can fail if XLM macros are blocked by policy.
    5. Ensure the host application actually enabled macros If a message such as “This document was opened with macros disabled” appears, the host application has opened the file with macros turned off. In that case, close the file and reopen it, then explicitly choose to enable macros following the instructions in Enable or disable macros in Microsoft 365 files.
    6. Be aware of security and managed environments In managed (corporate) environments, Group Policy or security baselines can override local Trust Center settings. Even if macros are enabled in Excel Options, organization-wide policies such as:
      • Block macros from running in Office files from the Internet, or
      • VBA Macro Notification Settings / Macro Notification Settings for Excel

    can still prevent macros from running. In that case, contact the administrator to review and adjust those policies if appropriate.

    1. Safety reminder Macros can contain malicious code. Only enable macros for files from trusted sources and locations, and prefer Disable VBA macros with notification over Enable all macros for ongoing use.

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.