Save changes?


Posted by lucky on February 01, 2002 6:22 AM

Hi all!
I have designed a well protected spreadsheet that upon auto_close a userform prompts the user to either Save As or Cancel (command buttons). If they choose Cancel, then the Excel standard prompt appears of 'Do you wish to save changes?'. Is it possible to have this prompt not appear and close the file without saving changes?
Cheers!

Posted by Benny on February 01, 2002 6:35 AM

*******


This should do the trick:

application.displayalerts = false

Posted by lucky on February 01, 2002 7:48 AM

I have inserted this under a command button chosen from userform2 that appears on auto_close. Dont work. Should I out this in a new module or somtething??


Private Sub CommandButton2_Click()
Application.DisplayAlerts = False

UserForm2.Hide
End Sub



Posted by Benny on February 01, 2002 10:31 AM

**** The command should be at the beginning of your sub routine, where it will be activated right away and run throughout the entire procedure (if there is a partciular point in time when you want alerts to be displayed you can always set the property to TRUE).