Share via

Excel Crashes when Macro is Enabled

Anonymous
2023-03-08T11:22:10+00:00

Hi,

I have an Excel macro utility which I maintain and is used by 100+ users in my team across the globe. The utility is heavy on automation using VBA. It worked fine for everyone until recent times when few of the users have started coming up with Excel crashing when the file is opened, and the macros are enabled.

As part of the support group in the team, I get the files from them which had crashed but strangely I am able to open the file without any issues. I then go to the VBA code editor and compile the code, then send it to them and miraculously it starts working for them. Unfortunately, I can't share the password to the users to perform this themselves and fix the file.

I checked the version of Excel, and it was a newer version than what I have and all runs on Windows 11.

Microsoft Excel for Office 365 MSO Version 2212 Build 16.0.15928.20278 64-bit

I tried few of the troubleshooting posted in the link below, but nothing helped.

https://answers.microsoft.com/en-us/msoffice/forum/all/enabling-macros-in-excel-causes-crashing/0937b62c-fcf6-4fc2-89e8-4f994b23af54

And one more strange observation is that the users facing the issue are all from North America region while I am from India. I don't know if that has got anything to do with the issue.

I am trying to find a permanent solution for this issue. Any suggestions are greatly appreciated.

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2023-03-10T05:07:25+00:00

    Thanks Andreas, I will try it out and keep posted.

    Was this answer helpful?

    0 comments No comments
  2. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2023-03-09T17:16:03+00:00

    Move the code into a new sub my_Procedure and in Auto_open use

    Application.OnTime Now + TimeValue("00:00:01"), "my_Procedure"

    Maybe increase the delay to 2 or 3 seconds.

    Andreas.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2023-03-09T16:09:32+00:00

    Hi Andreas, Yes, the macro executes code using Auto_Open function.

    Was this answer helpful?

    0 comments No comments
  4. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2023-03-08T11:30:01+00:00

    Do you execute code in Workbook_Open or Auto_Open?

    Andreas.

    Was this answer helpful?

    0 comments No comments