sassriverrat
Well-known Member
- Joined
- Oct 4, 2018
- Messages
- 655
hello-
I have a button that saves the workbook (code below). Irregardless if I save the workbook using the button (which works), when I go to close the program, it still asks me if I want to save (excel generated, not me). How can I get it so I don't have to save twice. I'd like it so that if I hit the save button, it saves and I can close without issues. If I hit close without having the second box come up.
Side note- I just typed that last piece up- maybe somebody knows how it's supposed to be written (assuming I'm wrong). It's so that the program won't be closed if other workbooks are opened, just this one.
Thanks!
Edit- Could this be from the last piece of code?
I have a button that saves the workbook (code below). Irregardless if I save the workbook using the button (which works), when I go to close the program, it still asks me if I want to save (excel generated, not me). How can I get it so I don't have to save twice. I'd like it so that if I hit the save button, it saves and I can close without issues. If I hit close without having the second box come up.
Side note- I just typed that last piece up- maybe somebody knows how it's supposed to be written (assuming I'm wrong). It's so that the program won't be closed if other workbooks are opened, just this one.
Thanks!
Edit- Could this be from the last piece of code?
Code:
Private Sub DailySaver()ActiveSheet.EnableCalculation = False
ActiveWorkbook.Save
'If Workbooks.Open > 1 Then
'Application.Quit
'Else: ActiveWorkbook.Quit
'End If
End Sub
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'This is the last event to run as Excel is closing
Sheets("Notes").Visible = xlVeryHidden
Sheets("Developer").Visible = xlVeryHidden
End Sub
Last edited: