Excel crashes when closing a active workbook

Jambai

New Member
Joined
Feb 24, 2011
Messages
7
Hello,

I have an excel file with macros in it. These macros are running fine on excel 2002/2003. We are upgrading MS Office in our company to Office 2010.

When I run the macros on Excel 2010, excel crashes at

ActiveWorkbook.Close savechanges:=True

The workbook is saved but it quits excel application. so, If I have other excel files open, all the files are closed.

If I split the above line as

ActiveWorkbook.SaveAs MasterBook.Path & "\Test.xlsm", FileFormat:=52
ActiveWorkbook.Close

It saves the workbook and crashes again at Activeworkbook.close

Can anyone please help me why this is happening?

Thanks in advance
PK
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I am having the same issue. Anyone have a solution? If I comment out the close line, everything works fine...just have a boat load of files to close afterwards.
 
Upvote 0
Found a solution that is working for me now:

Workbooks(wrkBookName).Save 'include only if you need to save the file first
Workbooks(wrkBookName).Saved = True
Workbooks(wrkBookName).Close
 
Upvote 0

Forum statistics

Threads
1,224,526
Messages
6,179,322
Members
452,906
Latest member
Belthazar

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