ActiveWorkbook.Close in .xlsm

Jambai

New Member
Joined
Feb 24, 2011
Messages
7
Hi,

How to close xlsm file through VBA code? When I use this code,
Code:
ActiveWorkbook.Close savechanges:=true
'or
ThisWorkbook.close savechanges:=true
'or
Workbooks("filename.xlsm").close savechanges:=true
the other excel files also being closed automatically.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Does your workbook have a Workbook_Close event, and if so, what code is there?
 
Upvote 0
No, it doesn't have Window_close. Actually it is converted from Excel 2003 to Excel 2010. It is working fine in 2003.

The .Close works fine, but it closes the other excel file also.

Thanks
 
Upvote 0
I'm no expert on Excel 2010 ( never used it ), and I don't know if there are any known bugs with it, sorry. If it worked in Excel 2003, then it's not likely to be a design problem.
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,741
Members
452,940
Latest member
rootytrip

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