Excel VBA on Mac not triggering Workbook events consistently

Santek Brenner 0 Reputation points
2025-12-10T11:40:15.77+00:00

I’m trying to automate a small workflow in Excel for Mac using VBA, but I’m running into an issue where standard Workbook events (like Workbook_Open and Worksheet_Change) don’t always fire. The same code works perfectly on Windows, but on macOS the events trigger only sometimes especially after reopening the file or switching sheets.

Is there a reliable way to ensure Workbook-level events run consistently on Excel for Mac

Microsoft 365 and Office | Excel | For education | MacOS
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michelle-N 9,240 Reputation points Microsoft External Staff Moderator
    2025-12-10T13:30:57.7333333+00:00

    Hi @Santek Brenner

    Thank you for reaching out via the Microsoft Q&A forum.

    Based on the information you shared, I understand that you are automating a workflow in Excel for Mac using VBA, but you are encountering an issue where standard Workbook events (like Workbook_Open and Worksheet_Change) do not trigger consistently. While the code works perfectly on Windows, the events on macOS only fire intermittently, particularly after reopening the file or switching sheets.

    To help me analyze this better, could you please provide the specific VBA code snippets you are using via Private Message?

    In the meantime, please try checking the following troubleshooting steps:

    1. Ensure Macros are Enabled

    First and foremost, ensure that macros are enabled on your Mac. Sometimes, Excel can disable macros for security reasons, preventing your events from firing.

    • Go to Excel > Preferences > Security & Privacy > Ensure that permissions are set to allow macros
    1. Use Application.OnTime for Delayed Execution

    In some cases on Mac, events try to fire before the workbook is fully loaded. Adding a slight delay to your event code may help ensure that the event triggers correctly. You can use Application.OnTime to schedule a procedure to run after a slight delay.

    1. Check Application.EnableEvents

    Occasionally, Excel might disable events after certain actions (especially after errors). You can use Application.EnableEvents = True inside your Workbook_Open or Workbook_Activate event to make sure they are active.

    Is EnableEvents being intentionally disabled elsewhere in your code? If you wrote the code, check if you set Application.EnableEvents = False at some point (to prevent infinite loops) but forgot to set it back to True, perhaps due to code exiting before reaching the end of a subroutine.

    1. Test in a New Workbook

    If possible, test your code in a completely new workbook on your Mac. There might be something specific to the current workbook (corruption, specific settings, or add-ins) that is interfering with event handling. If the new workbook works fine, you may want to look into repairing the original file.

    Please let me know the results!


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

    Note: Follow the steps in our documentation to enable email notifications if you want to receive notification related to this topic.

    0 comments No comments

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.