Tsudoi has attended:
Excel PowerPivot course
Excel VBA Introduction course
Disable popup to enter Password to unprotect sheet
Hi,
I have a file that has the following code which triggers a popup to enter enter Password to unprotect sheet when the file opens. I'd like to stop this popup from appearing ever time the file opens but still keeping the protection valid. I simply don't want the popup to prompt. How can I change the code to achieve that please?
Option Explicit
Private Sub Workbook_Open()
Application.Goto Sheets("Read Me").Range("A1:W58"), True
With Worksheets("1. Template")
.EnableOutlining = True
.Protect UserInterfaceOnly:=True
End With
End Sub
RE: Disable popup to enter Password to unprotect sheet
Hi Tsudoi
If you check the link I sent you in your original forum request it provides examples for the code for protecting and unprotecting the worksheet.
https://www.thespreadsheetguru.com/the-code-vault/groups-expand-collapse-sheet-password-protection
'Password Protect Current Sheet
ActiveSheet.Protect Password:="", UserInterfaceOnly:=True
'Unprotect Sheet
ActiveSheet.Unprotect ""
Regards
Dennis