Hello guys,
I have a problem concerning macro's ... I made an excel workbook that will
show a sheet if macro's are disabled. Only that sheet will appear, in which it says
that people need to enable the macro's, close the file and then reopen.
When macro's are enabled people will not see that sheet again, and can start
answering questions and go through the rest of my sheets.
I found some files doing that under the name 'Splash' I don't know if anybody is familiar
with that term.
Anyway the problem is the following, I have multiple sheets that I want to show,
but I always want to start with the sheet called "Start Enquete" ... but the problem I
have is that other pages will show, after I have saved the file or quit the program.
The codes that I have are the following:
What do I need to change at the code so that always when open the file,
when macro's are enabled, the file starts with Sheets("Start Enquéte")???
Thanks for the help!!
I have a problem concerning macro's ... I made an excel workbook that will
show a sheet if macro's are disabled. Only that sheet will appear, in which it says
that people need to enable the macro's, close the file and then reopen.
When macro's are enabled people will not see that sheet again, and can start
answering questions and go through the rest of my sheets.
I found some files doing that under the name 'Splash' I don't know if anybody is familiar
with that term.
Anyway the problem is the following, I have multiple sheets that I want to show,
but I always want to start with the sheet called "Start Enquete" ... but the problem I
have is that other pages will show, after I have saved the file or quit the program.
The codes that I have are the following:
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Application
.EnableCancelKey = xlDisabled
.ScreenUpdating = False
Call HideSheets
.ScreenUpdating = True
.EnableCancelKey = xlInterrupt
End With
ThisWorkbook.Save
ThisWorkbook.Saved = True
End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
With Application
.EnableCancelKey = xlDisabled
.ScreenUpdating = False
Call HideSheets
.ScreenUpdating = True
.EnableCancelKey = xlInterrupt
End With
ThisWorkbook.Save
ThisWorkbook.Saved = True
End Sub
Private Sub Workbook_Open()
ActiveSheet.Unprotect ("")
'Unhide all worksheets
With Application
.EnableCancelKey = xlDisabled
.ScreenUpdating = False
Call UnhideSheets
.ScreenUpdating = True
.EnableCancelKey = xlInterrupt
End With
ActiveSheet.Protect ("")
End Sub
Private Sub HideSheets()
Dim Sheet As Object
With Sheets("Macros")
.Visible = xlSheetVisible
For Each Sheet In Sheets
If Not Sheet.Name = "Macros" Then
Sheet.Visible = xlSheetVeryHidden
End If
Next
Set Sheet = Nothing
End With
End Sub
Private Sub UnhideSheets()
Sheets("Start Enquéte").Visible = xlSheetVisible
Sheets("Macros").Visible = xlSheetVeryHidden
Sheets("Clustermanagers blad 1").Visible = xlSheetVisible
Sheets("Clustermanagers blad 2").Visible = xlSheetVisible
Sheets("Clustermanagers blad 3").Visible = xlSheetVisible
Sheets("Clustermanagers blad 4").Visible = xlSheetVisible
Sheets("End").Visible = xlSheetVisible
End Sub
when macro's are enabled, the file starts with Sheets("Start Enquéte")???
Thanks for the help!!