Excel crashes when opening file - maybe macros issue

leojez

Board Regular
Joined
Apr 12, 2022
Messages
51
Office Version
  1. 365
Platform
  1. Windows
Hello,

An excel file I've been working on has suddenly started crashing every time I open it. It could be a dud macro, not sure. The problem is I can't get it open to check. I've tried the following:

1. Open your file within Excel: Menu > File > Open > Recent Workbooks and hold down the Shift key when clicking on the file name.
--> This doesn't work, it still shuts down instantly

2. The steps in this post: Excel Crashes When Opening Trusted Document With Macros Or Enabling Macros
--> Again, this doesn't work, it still shuts down instantly

3. Opening the file in Protected View.
--> This opens the file and it stays open. However, as soon as I click on "Enable Editing" it shuts down again.

It's a lot of work to loose so I can very concerned. Is there anyone who can help, please?

Thanks!
 
Let's try first option again.
Close all Excel applications in the task manager.
Open new workbook and in the VBA editor insert this code in the new module...
VBA Code:
Sub OpenFileWithVBA()

    Application.FindFile
 
End Sub
Run this code line by line with keyboard key "F8".
Find your problematic file, select it and press button "Open".
If message box "Want to save your changes?" appear press button "Cancel".
Now you should have two opened Excel files.
Close first file but do not close file with problematic code.
Go to the VBA Editor => ThisWorkbook => Workbook_Open event and again with "F8" key check line by line looking for the problematic line.
When you find it, change it and save Workbook.
Close workbook. Open it. Now should works.
Hi, same thing again I'm afraid. As soon as I open the file it crashes. Here's a video showing it happening twice:

 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Maybe your add-ins "IB_Excel_Adapter" have some time limitations.
Go to add-ins and uncheck (disable) this add-ins.
Then try to open problematic file.
 
Upvote 0
Maybe your add-ins "IB_Excel_Adapter" have some time limitations.
Go to add-ins and uncheck (disable) this add-ins.
Then try to open problematic file.
Good idea, but unfortunately that didn't work. Thanks for all your help, I really appreciate it. It seems to be a lots cause. I've got a few backups so I'll go back to them and redo all that is lost.

Thanks again.
 
Upvote 0
Ok.
It's good to have a backups, especially when you are still new in some things.:coffee:
 
Upvote 0
Hello,

An excel file I've been working on has suddenly started crashing every time I open it. It could be a dud macro, not sure. The problem is I can't get it open to check. I've tried the following:

1. Open your file within Excel: Menu > File > Open > Recent Workbooks and hold down the Shift key when clicking on the file name.
--> This doesn't work, it still shuts down instantly

2. The steps in this post: Excel Crashes When Opening Trusted Document With Macros Or Enabling Macros
--> Again, this doesn't work, it still shuts down instantly

3. Opening the file in Protected View.
--> This opens the file and it stays open. However, as soon as I click on "Enable Editing" it shuts down again.

It's a lot of work to loose so I can very concerned. Is there anyone who can help, please?

Thanks!
Microsoft Excel may crash due to any one or more reasons that include incompatible Add-ins, conflict with other programs, Outdated MS Excel programs or compatible issues are common.

The very first step you need to perform to check if certain add-ins are interfering with your Excel sheet:

1: Start Excel in Safe Mode:
  • Press Windows key + R, type excel.exe /safe, and click ok
  • This will open Excel in a safe mode.
If the Excel still keeps on crashing, then move on to the next method.

2: Remove Problematic Add-in by checking possible issues:

You can find out and remove the problematic add-ins following the steps below.
  • Open an Excel file and navigate to File > Options > Add-ins.
  • Expand the menu of Manage, choose COM Add-ins, and click the Go button.
  • In the pop-up window, uncheck the add-ins you want to disable and click OK to confirm.
Once done close the excel sheet and open it again normally check if there is no more problem with the excel sheet.

3: Open and Repair the Excel Sheet:

Still need help, Try the Open and Repair method to get rid of this crashing excel file issue:
  • Press Windows key + S type excel and select Microsoft excel from there,
  • On the File tab then Open, click Browse, and locate the excel sheet (which is causing the problem) select it
  • Click the arrow next to the Open button and then click “Open and Repair”.
  • A new popup opens, here click “Repair” if you want to recover as much Excel data as possible,
  • Click “Extract Data” to extract values and formulas from Excel when an attempt to repair the Excel is not successful.
I hope any of these methods could work for you to solve the error, Else you can go through the below URL:

https://social.technet.microsoft.co...ting-opening-or-saving-file-causes-crash.aspx

Best Regards,

Alice
 
Upvote 0
Microsoft Excel may crash due to any one or more reasons that include incompatible Add-ins, conflict with other programs, Outdated MS Excel programs or compatible issues are common.

The very first step you need to perform to check if certain add-ins are interfering with your Excel sheet:

1: Start Excel in Safe Mode:
  • Press Windows key + R, type excel.exe /safe, and click ok
  • This will open Excel in a safe mode.
If the Excel still keeps on crashing, then move on to the next method.

2: Remove Problematic Add-in by checking possible issues:

You can find out and remove the problematic add-ins following the steps below.
  • Open an Excel file and navigate to File > Options > Add-ins.
  • Expand the menu of Manage, choose COM Add-ins, and click the Go button.
  • In the pop-up window, uncheck the add-ins you want to disable and click OK to confirm.
Once done close the excel sheet and open it again normally check if there is no more problem with the excel sheet.

3: Open and Repair the Excel Sheet:

Still need help, Try the Open and Repair method to get rid of this crashing excel file issue:
  • Press Windows key + S type excel and select Microsoft excel from there,
  • On the File tab then Open, click Browse, and locate the excel sheet (which is causing the problem) select it
  • Click the arrow next to the Open button and then click “Open and Repair”.
  • A new popup opens, here click “Repair” if you want to recover as much Excel data as possible,
  • Click “Extract Data” to extract values and formulas from Excel when an attempt to repair the Excel is not successful.
I hope any of these methods could work for you to solve the error, Else you can go through the below URL:

https://social.technet.microsoft.co...ting-opening-or-saving-file-causes-crash.aspx

Best Regards,

Alice
Thanks for those ideas Alice! I've rebuilt the file now but if I have any issues I'll try these.
 
Upvote 0
Hello,

An excel file I've been working on has suddenly started crashing every time I open it. It could be a dud macro, not sure. The problem is I can't get it open to check. I've tried the following:

1. Open your file within Excel: Menu > File > Open > Recent Workbooks and hold down the Shift key when clicking on the file name.
--> This doesn't work, it still shuts down instantly

2. The steps in this post: Excel Crashes When Opening Trusted Document With Macros Or Enabling Macros
--> Again, this doesn't work, it still shuts down instantly

3. Opening the file in Protected View.
--> This opens the file and it stays open. However, as soon as I click on "Enable Editing" it shuts down again.

It's a lot of work to loose so I can very concerned. Is there anyone who can help, please?

Thanks!
HI Leojez,

A bit late to the party, but I've just had a similar issue with one of my VBA Workbooks. If you happened to still have the original file, you might want to try to see if this could fix it in case it happens again in the future.

I found that sometimes even if there is no glitchy code and all the VBA should work, Excel just decides that specific instance of the file (that save) will not open as soon as the code is run. What I have found to fix the problem is the following:
- Disable auto-enable macros in Excel preferences
- Close all instances of Excel
- Double click the workbook to open from Windows and DO NOT enable macros/active content as per the small notification bar at the top
- Alt + F11 to open VBA editor
- If you have a Workbook_Open sub, I found it works best here, but if not then go to any sub/code that you know runs on first opening the file
- Click the middle bar or use F9 to toggle Breakpoint on a few random lines and then remove the Breakpoint, also edit some of the code with random characters/returns/line breaks and then delete those characters/returns/line breaks (essentially add some breakpoints/edit the code and then undo those changes manually - DO NOT use Ctrl + Z)
- Save As the workbook (F12) as a new macro-enabled workbook/template (whatever format your file is)
- Opening the new Saved As file most times will no longer encounter the immediate close and restart error

Hope this helps anyone else in the same situation.

Regards,
Ruohan
 
Upvote 0
HI Leojez,

A bit late to the party, but I've just had a similar issue with one of my VBA Workbooks. If you happened to still have the original file, you might want to try to see if this could fix it in case it happens again in the future.

I found that sometimes even if there is no glitchy code and all the VBA should work, Excel just decides that specific instance of the file (that save) will not open as soon as the code is run. What I have found to fix the problem is the following:
- Disable auto-enable macros in Excel preferences
- Close all instances of Excel
- Double click the workbook to open from Windows and DO NOT enable macros/active content as per the small notification bar at the top
- Alt + F11 to open VBA editor
- If you have a Workbook_Open sub, I found it works best here, but if not then go to any sub/code that you know runs on first opening the file
- Click the middle bar or use F9 to toggle Breakpoint on a few random lines and then remove the Breakpoint, also edit some of the code with random characters/returns/line breaks and then delete those characters/returns/line breaks (essentially add some breakpoints/edit the code and then undo those changes manually - DO NOT use Ctrl + Z)
- Save As the workbook (F12) as a new macro-enabled workbook/template (whatever format your file is)
- Opening the new Saved As file most times will no longer encounter the immediate close and restart error

Hope this helps anyone else in the same situation.

Regards,
Ruohan
Really helpful info Ruohan, thanks!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top