I have the following code set to run before a workbook close event and it never gets out of the loop:
Any help?
Code:
Sub HideSheets()
Dim sht As Object
Dim saveresponse As Boolean
Application.ScreenUpdating = False
ThisWorkbook.Sheets("Macros Disabled").Visible = xlSheetVisible
For Each sht In ThisWorkbook.Sheets
If sht.Name <> "Macros Disabled" Then sht.Visible = xlSheetVeryHidden
Next sht
Do Until saverespone = True
MsgBox "You Must save a copy of this file before exiting the spreadsheet otherwise it may not function correctly when opening the spreadsheet again." & vbNewLine & vbNewLine & "This may up to 1 minute or more depending on your computer speed.", vbCritical, "Saving the File is Required"
saveresponse = Application.Dialogs(xlDialogSaveAs).Show
Loop
Application.Quit
End Sub
Any help?