ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trying to close without the message do you want to save (https://www.excelbanter.com/excel-programming/394232-trying-close-without-message-do-you-want-save.html)

David A.

Trying to close without the message do you want to save
 
The save alert is still popping up. What do I do to just open the page
"Open" and save without the pop up?
Private Sub Workbook_Close()
Application.DisplayAlerts = False
Application.CommandBars("Standard").Visible = True
Application.CommandBars("Formatting").Visible = True
Application.CommandBars("Visual Basic").Visible = True
Application.CommandBars("Control ToolBox").Visible = True
Application.CommandBars("Forms").Visible = True
Application.CommandBars("Web").Visible = True
Sheets("Open").Select
Range("A75").Select
For Each w In Application.Workbooks
w.Save
Next w
ActiveWorkbook.Close
End Sub

Anony

Trying to close without the message do you want to save
 
Replace with this
ActiveWorkbook.Close (False)
Since you've already saved.

--------
Cheers,
Anony


"David A." wrote:

The save alert is still popping up. What do I do to just open the page
"Open" and save without the pop up?
Private Sub Workbook_Close()
Application.DisplayAlerts = False
Application.CommandBars("Standard").Visible = True
Application.CommandBars("Formatting").Visible = True
Application.CommandBars("Visual Basic").Visible = True
Application.CommandBars("Control ToolBox").Visible = True
Application.CommandBars("Forms").Visible = True
Application.CommandBars("Web").Visible = True
Sheets("Open").Select
Range("A75").Select
For Each w In Application.Workbooks
w.Save
Next w
ActiveWorkbook.Close
End Sub



All times are GMT +1. The time now is 03:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com