Annoying Problem With VBA Editor Crashing Excel

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
3,922
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I am working on an Excel VBA project and have recently started encountering a very annoying problem.
When I am testing my project, if I run into an error, or I stop to step through and make changes based on the results encountered while stepping through, and attempt to save these changes or corrections, Excel crashes. No error messages, it just folds up and restarts the project as if nothing happened. It's the original file, not a backed up one that is started, and the changes made are not reflected. (Assuming the save was unsuccessful).

If I don't execute my code in my project, and just go straight to making known changes or corrections and save, I'm fine. It's only after my code has been executed.

I know it's a crap shoot, but is there any way I can determine what is causing this crash?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Marc L

Well-known Member
Joined
Apr 5, 2021
Messages
927
Office Version
  1. 2010
Platform
  1. Windows
Start directly in Step-By-Step debug mode in order to see which is the codeline raising the crash …​
And obviously you must stop first the execution before saving the workbook …​
 

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
3,922
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Thanks Marc L.
I am in step-by-step prior to when I try to save (which crashes). I step through, make the correction or change, and try to save from the editor save button. Whether I stop first or not, it behaves the same. Whether I try to save from the VBA editor of Excel proper, I get the same behaviour. I get no error messages while stepping through, or as it (attempts to) save. It just shuts down and restarts fresh. It was almost like it was saving (but it isn't ... no changes appear to have been saved), closing and then restarting (without the changes).

Perhaps a computer restart ...
 

Marc L

Well-known Member
Joined
Apr 5, 2021
Messages
927
Office Version
  1. 2010
Platform
  1. Windows
Yes obviously a computer restart may help as Excel not well manages the memory …​
And in such case the better is to save the workbook if necessary before to launch any VBA procedure​
 

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
3,922
Office Version
  1. 365
  2. 2016
Platform
  1. Windows

ADVERTISEMENT

Unfortunately that didn't do it. I've tried a Office Quick Repair. We'll see if that does the trick.
 

Marc L

Well-known Member
Joined
Apr 5, 2021
Messages
927
Office Version
  1. 2010
Platform
  1. Windows
Maybe clean the Windows Temp folder, the Temp folder of the Windows session and the Office cache folder …​
 

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
3,922
Office Version
  1. 365
  2. 2016
Platform
  1. Windows

ADVERTISEMENT

Nope ... that didn't do it either. Must be something in my code, and likely with a form that was in use prior to the save attempt. Only crashes after having accessed the form.
 
Last edited:

Marc L

Well-known Member
Joined
Apr 5, 2021
Messages
927
Office Version
  1. 2010
Platform
  1. Windows
Hoping the workbook does not use some ActiveX control …​
 

Marc L

Well-known Member
Joined
Apr 5, 2021
Messages
927
Office Version
  1. 2010
Platform
  1. Windows
The better !​
Maybe the workbook is damaged, try on another one in a similar situation …​
 

Watch MrExcel Video

Forum statistics

Threads
1,132,901
Messages
5,655,872
Members
418,249
Latest member
JOYADA

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
Top