• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Display alert = false query

Rob Webster

New Member
Hi All,

does anyone know if there is there a way to switch off the alert which pops up when saving a file.

the alert I mean is the one which gives the progress of the save, and an option to cancel. during saving

I am wanting to remove the option to cancel as this stops the rest of the code finishing the job.

I have tried using display alert = false before the code runs but it doesn't seem to prevent that particular alert from popping up.

thanks to anyone able to offer advice.
 
Thanks for your reply.

I tried that but I need the workbook to save, just without the message.

using that line before file.close - exits the file without saving it.
 
Hi Thank you, That works for saving then immediately closing fine which i do at the end.

In the middle of the code I have a save as, and then carry out some work on the new workbook, before that final close. i do the save as because I need to save a pre-amended copy of it before the changes are made because they are extensive. lots of sheets deleted, named ranges etc, to leave a much simpler workbook.

the user just gets a chance to cancel the save as when the pop up appears to give progress of the save. i'm not sure if its possible to not display it. in the above scenario.
 
Hi thanks for your feedback, that's what I used in my code. Sorry just badly worded it in the post.

I put that in at the start and then the same again at the end except using "=true" on the end, to switch them back on.
 
Try this!
Code:
To save:
ActiveWorkbook.Close SaveChanges:=1
or
ActiveWorkbook.Close True

Or to not save:
ActiveWorkbook.Close SaveChanges:=0
or
ActiveWorkbook.Close False


To Stop Alerts:
Applicaton.displayAlerts =False
<Code goes here>
Applicaton.displayAlerts =True
 
Back
Top