Private Sub Workbook_Open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Sheet1" Then ws.Visible = xlSheetVeryHidden
Next
End Sub
I was doing a bit more testing on the idea and did notice a cause for concern.
When you try to close the workbook, it will ask you to save.
If you choose not to save then the sheets will not be hidden as required.
If you choose to save then it will also save any previous changes that you may want to discard.
If you force save as part of the procedure then it will also save any changes that you may want to discard.
There will be ways around the problem, I'll wait for feedback from you as to what will be necessary before looking into it further.
Private Sub Workbook_Open()
Dim ws As Worksheet
Application.Wait Now + TimeSerial(0, 0, 5)
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next
ThisWorkbook.Save
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim ws As Worksheet
Application.EnableEvents = False
With ThisWorkbook
For Each ws In .Worksheets
If ws.Name <> "Sheet1" Then ws.Visible = xlSheetVeryHidden
Next
.Save
End With
Application.EnableEvents = True
Application.Wait Now + TimeSerial(0, 0, 5)
End Sub