Background:
Excel version: 2007
Operating System: Windows 7 x64
All macros enables, trust access to VBA
Problem
I recently upgraded from windows XP to windows 7. Now excel crashes when I try to save a specific file after running the macro contained within it.
By stepping through the code, I found that the problem occurs once the following line has been executed:
Workbooks("BI20.xlsx").Close savechanges:=False
I can save the workbook anytime before that and do not get a crash. However, after that line has executed, excel summarily crashes when I try to do a save or save as.
My application settings while running the code are as follows:
With Application
.ScreenUpdating = False
.EnableCancelKey = xlDisabled
.Calculation = xlCalculationAutomatic
End With
I tested the same file again today use my old xp machine and it worked completely flawlessly allowing me to save the file without error. I attached the full code executed for your reference and to serve as an example in case I missed something obvious.
Other macro files work fine and I have had no other problems saving files with my new system. It is definitely isolated to this one file.
Any ideas on how to fix?
So far manually copying and pasting the code to a new workbook and recreating the tabs did not resolve the issue. Saving the file as a different name did not resolve the issue. Commenting out the lines of code that contain save instructions also did not resolve the problem.
Thanks in advance,
-Michael
Bookmarks