Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Skip prompt when closing a file within a macro

Status
Not open for further replies.

lj50v

Programmer
Sep 21, 2008
6
AU
Hi there,

I was wondering if anyone knows how to stop the message 'Do you want to Save <filename>', when you close a file from within a macro.
Up to now I have just had to let the user say 'Yes' or 'No' but it would be nice to just be able to do it without confusing the user.

Thanx in anticipation

lj50v
 
I was taught, by this forum:

Application.DisplayAlerts = False

Just have to be careful when and how it is used.
 
Up to now I have just had to let the user say 'Yes' or 'No' but it would be nice to just be able to do it

Hmmmm, does that mean a decision needs to be made? Saved, or not saved? Is it up to the user?

If the decision (either way) is up to YOU, the developer, then yes you can do it (either way). However, if it does need to be saved, make sure you do so before you use:
Code:
Workbooks("BOOK1.XLS").Close SaveChanges:=[b]False[/b]

"A little piece of heaven
without that awkward dying part."

advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top