Excel crashes when opening a macro enabled excel file intermittently

Patrick 0 Reputation points
2024-05-22T17:58:37.35+00:00

I have an issue with a macro enabled excel file crashing intermittently. The file starts as a blank template for users to add data, sheets and images to. They can make copies of the template file. But every so often we run into an issue with certain files crashing excel. Here are the symptoms:

  1. When opening the file from file explorer (double clicking the file) excel starts to open, I begin to see the spreadsheet open then excel crashes.
  2. Opening the file in safe mode produces the same results as #1.
  3. Excel application is running. I go to File > Open > Browse (opens up excel file explorer) > select and click open I get a window saying "There isn't enough memory to complete this action. Try using less data or closing other applications." And excel crashes. I have similar spreadsheets that are much larger and they do not have this issue.
  4. Same as #3 but instead I 'Open and Repair'. This gives a xml file that says the following: http://schemas.openxmlformats.org/spreadsheetml/2006/main">error349040_01.xmlErrors were detected in file 'redacted excel file name and location.xlsm'. Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.

This fixes the file and I am able to save as it with no problems. Nothing has changed with the 'repaired' file other than its size (as far as I know). I notice this reduced the file size from ~1000KB to ~800KB. But when I open VBA editor and compile the code I see that the file size then increases back to about its original.

  1. I do have a version of this file that when running a macro, the file errors after running a few lines of code and the debugger gives the message "There isn't enough memory to complete this action...". Just like #3.

This issue comes and goes for other users who have local copies of this file. We see this is mainly after the file has been saved and close for a day then re-opened without any changes made. Looking for some suggestions on what this could be. Thank you in advance.

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,611 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,650 questions
0 comments No comments
{count} votes