ActiveWindow.Close without popup?

smakatura

Board Regular
Joined
May 27, 2011
Messages
141
HTML:
ActiveWindow.Close


The above code in my macro. When I use this command, it has a popup that asks me if I want to save my changes. I want it to not give me the popup and just close the file. I do not want to save my changes.

is there a command I can use that will just close the active window (without saving and without asking me via a popup)?
 
Last edited:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Are you actually closing a workbook?

If you are then if you used the Close method you could set the SaveChanges argument to False so you don't get that popup.
Code:
Workbooks("WorkbookToClose.xlsx").Close SaveChanges:=False
 
Upvote 0
HTML:
ActiveWindow.Close savechanges:=False

above code worked great.

I could not get the workbook coding to work.

but I am good now, thanks guys
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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