Hi there,
In the below section of code I'd like to call the 'save changes' dialogue so the user is asked 'do you want to save changes' before the code hides workseets and shows the welcome sheet - After searching all I can find is the Application.GetSaveAsFilename but I don't want to save as a new file or to automatically save/not save just in case
This is so that it doesn't confuse users who are using the sheet properly because as it is the welcome sheet pops up behind the save changes dialogue box when they close but haven't saved their changes, the code i'm using is simply to run a timer to close the workbook after 5 mins of inactivity and there's a hide all sheets except the welcome sheet so that if they don't enable content and let the timer run they cant access the data ie if you don;t enable content all you see is a welcome sheet that says 'please click enable content' with all other sheets hidden
Grateful of any help thank you.
In the below section of code I'd like to call the 'save changes' dialogue so the user is asked 'do you want to save changes' before the code hides workseets and shows the welcome sheet - After searching all I can find is the Application.GetSaveAsFilename but I don't want to save as a new file or to automatically save/not save just in case
This is so that it doesn't confuse users who are using the sheet properly because as it is the welcome sheet pops up behind the save changes dialogue box when they close but haven't saved their changes, the code i'm using is simply to run a timer to close the workbook after 5 mins of inactivity and there's a hide all sheets except the welcome sheet so that if they don't enable content and let the timer run they cant access the data ie if you don;t enable content all you see is a welcome sheet that says 'please click enable content' with all other sheets hidden
Grateful of any help thank you.
VBA Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call StopTimer
'call do you want to save changes dialogue box if there are unsaved changes
Application.ScreenUpdating = False
Sheets("Welcome").Visible = xlSheetVisible
For Each Sh In Worksheets
If Not Sh.Name = "Welcome" Then Sh.Visible = xlVeryHidden
Next Sh
End Sub