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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get rid of save changes dialogue box

Status
Not open for further replies.

bozic12

MIS
Jan 23, 2003
48
US
Hi,
I have a user form with a close form button. The sub for this button is simple:
Private Sub CloseButton_Click()
Unload Me
Application.Quit
End
End Sub

Since Macros run in excel, after this button is clicked, the "do you want to save the changes you made to configurator.xls?" dialogue box appears when it closes excel. Is there any way to disengauge this box, or at least choose the "no" option using VBA code?
 
You can try this:

Application.DisplayAlerts = False

I am not sure it will work as I use it for a special save function that I created...

Below: (not related to your question, but shows the context of the syntax)
-----------------
'Save as file in CSV format
Filesavename = Application.GetSaveAsFilename(InitialFileName:="Upload_" + period + "_" + trans + ".SAL", fileFilter:="Reporting data (*.sal), *.sal")

ActiveSheet.SaveAs filesavename, FileFormat:=xlCSV
Application.DisplayAlerts = False
ActiveWorkbook.Close

MsgBox "The upload file has been saved", vbInformation, "Upload saved"
---------------------

Regards,

MDA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top