Excel 2007 crashing when saving workbook after running macro

1

I am using Excel 2007 (32Bit) on a Windows 7 64Bit machine.

I have a large Workbook with 12 sheets and 18 VBA modules.

All of my subroutines run flawlessly but one is causing the following issue:

The macro itself runs from start to finish successfully just as specified. After running the macro successfully, the workbook crashes, when I try to save it. It also crashes when AutoSave tries to save the workbook. The workbook does not crash when I simply close it. By crashing, I mean that I get the message "Microsoft Office Excel has stopped working".

In the Windows Event Viewer I have identified the error message 0xc0000005.

In the folder where the workbook is saved, I find the temporary files that Excel creates when saving a workbook (named something like 9BB7B000).

I have tried to repair Excel in the Programs and Features part of the Control Panel but it has not worked. Furthermore no Add-Ins are enabled.

I suspected that the code module of the problem-causing macro was too large (90KB) so I split it up into two modules smaller than 64KB. However, the problem remains.

I would appreciate any help on this issue. I would like to get around reconstructing the workbook manually, if possible, as that would mean an enormous effort.

Thank you very much in advance.

Jochen

excel
vba
crash
save
asked on Stack Overflow Aug 7, 2014 by jokken • edited Feb 17, 2015 by pnuts

3 Answers

0

I had the same issue some time ago and carried out a research to identify the issue to no avail.

I noticed that it worked fine on workstations with better procs and more ram.

However the only way for me to proceed was to create a new workbook a one-by-one copy each worksheet from the old workbook and see which one is causing the issue. If the macro is causing the error then try to add a "sleep" command between loops so that the Excel file regains control and can execute and awaiting events/commands.

answered on Stack Overflow Aug 7, 2014 by AnalystCave.com
0

The post was 9 months ago, could you fix it?

What does that specific macro do? Because there are several solutions to this problem.

It seems that a certain "action" in your macro takes too long. You can search for that specific action and us application.wait to slow your macro down. If this doesn't work, you'll have to find a way to reduce the "workload". But to do that, i'll need to take a look at your code.

answered on Stack Overflow May 28, 2015 by Nathalii.
0

Turn off the AutoSave function in Excel Options

answered on Stack Overflow Aug 15, 2019 by Maga

User contributions licensed under CC BY-SA 3.0