How to enable macros on a single excel file on mac

Jesper Dioth 0 Reputation points
2026-09-01T23:30:30.4833333+00:00

I need to access the VBA code in excel, and because macros are disabled, the VBA won't run. Can i please get some advice?

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

2 answers

Sort by: Most helpful
  1. Hendrix-V 18,515 Reputation points Microsoft External Staff Moderator
    2026-09-02T07:17:13.6+00:00

    Hi Jesper Dioth,

    If you only need to work with one trusted workbook, you may want to check whether the file is opening in a protected or restricted state. On Mac, a quick test is to save a copy of the workbook to a local folder (such as Documents), reopen it from there, and then try accessing the VBA project again. In some cases, opening the file from certain locations can affect how Excel handles macro-enabled workbooks.

    You can also confirm that the workbook is saved in a macro-enabled format (.xlsm). If the file was saved in a standard workbook format (.xlsx), the VBA project will not be available.

    If the VBA editor still cannot be accessed after confirming the file location and format, please let me know:

    • Your Excel version (Microsoft 365, Excel 2024, etc.)
    • Whether the workbook is an .xlsm file
    • Any error message shown when opening the VBA editor

    With that information, the community can suggest more targeted troubleshooting steps.

    Let me know if you need further assistance, feel free to ask me by clicking "Add Comment" or "Add Answer" if you cannot add comment so your response will be visible. Thanks for your effort.


    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?


  2. AI answer

    2026-09-01T23:30:43.0966667+00:00

    On Excel for Mac, macros are controlled at the app level rather than enabled per individual file in the way described.

    To allow a macro-enabled workbook to run VBA:

    1. Open Excel.
    2. Select Excel > Preferences.
    3. Select Security.
    4. Choose one of these settings:
      • Disable all macros with notification — recommended default. Excel prompts when a file contains macros.
      • Enable all macros — allows all macros to run.

    Use Disable all macros with notification if possible, then open the workbook and allow the macro when prompted. Only use Enable all macros if the file is trusted.

    If the goal is to access or edit VBA code:

    1. Enable the Developer tab:
      • Go to Excel > Preferences... > Ribbon & Toolbar.
      • Under Main Tabs, check Developer.
    2. Open the workbook.
    3. On the Developer tab, select Macros to run a macro, or select Visual Basic to open the Visual Basic Editor.

    Caution: enabling all macros allows all macro code to run without further warning.


    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.