"Do You Want to Save Changes" message window

R

RLY

I'm ending a simple data transfer macro with:

Windows(DwnldName).Activate
Application.CutCopyMode = False
ActiveWindow.Close

However, I still receive that "Do you want to save changes" message window
before the system will close the "source" spreadsheet. Can I add some code to
bypass this step & force the source to close w/o saving?

Thanks, Robert
 
F

FSt1

hi
at the beginning of your code add..
application.displayalerts = false
then at the end of your code, be sure to turn alerts back on.....
application.displayalerts = true

Regards
FSt1
 
D

Dave Peterson

I'd drop the use of the windows collection and use something like:

Workbooks(dwnldname).close savechanges:=false

Where dwnldname is a variable that includes the extension, right?
 
A

AltaEgo

Leave it either way to the user whether or not to save:

Application.DisplayAlerts = False
ActiveWindow.Close
Application.DisplayAlerts = True


OR
ActiveWindow.Close SaveChanges:=False'does not save changes

OR
ActiveWindow.Close SaveChanges:=True ' save changes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top