Closing a workbook during a macro without saving it

Ajtoo

New Member
Joined
Mar 14, 2002
Messages
5
I wish to close a workbook during a macro without saving it.
Currently, the vba command 'ActiveWorkbook.Close' brings up the usual dialogue box asking if I wish to save or not and I am able to select No, but wish to automate this process.
Due to the large amount of data, I also get a message if I want to save the data in the clipboard - again I wish to automate the No option.
How can I do this?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
On 2002-03-18 01:49, Ajtoo wrote:
I wish to close a workbook during a macro without saving it.
Currently, the vba command 'ActiveWorkbook.Close' brings up the usual dialogue box asking if I wish to save or not and I am able to select No, but wish to automate this process.
Due to the large amount of data, I also get a message if I want to save the data in the clipboard - again I wish to automate the No option.
How can I do this?

ActiveWorkbook.Close False


For the clipboard...just clear it with
Application.cutcopymode = false


HTH

Ivan
 
Upvote 0

Forum statistics

Threads
1,214,424
Messages
6,119,400
Members
448,893
Latest member
AtariBaby

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