I have a workbook that gives users access to info and they can then print it out but when they close the book I don't want them to save any changes. I used this code from a button created from the control toolbox:
Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
Application.Quit
End Sub
It just closes the program, no questions asked.
If you want to save the changes and close the book with no questions asked, try this:
Option Explicit
Private Sub CommandButton1_Click()
Dim i As Variant
For i = 1 To Workbooks.Count
Workbooks(i).Save
Next i
Application.DisplayAlerts = False
Application.Quit
End Sub
Steve