Stop Excel Saving Via VBA

kingy

New Member
Joined
Sep 14, 2002
Messages
14
Im currently programming a excel workbook but when the code application.quit is used a confirmation box appears saying do you want to save blah blah, yes, no, cancel etc.

Is there a way of getting excel to close but not displaying this message box, i could use activeworkbook.save then application.quit but the problem is in this instance i dont want to save the workbook, any ideas ne one???
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

seacrest

Active Member
Joined
Aug 15, 2002
Messages
301
Try this
Sub auto_close()
ActiveWorkbook.Close SaveChanges:=False
End Sub
 

Forum statistics

Threads
1,181,233
Messages
5,928,801
Members
436,629
Latest member
abc32

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