Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

disable popup enter password

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Disable popup to enter Password to unprotect sheet

Disable popup to enter Password to unprotect sheet

ResolvedVersion 2016

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

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Using Alt in Save Dialog Box

When you are saving (or opening) a file, try these;
(Note the numbers are on the keyboard not the numeric keypad)
1. Go to previous folder Alt+1
2. Go up one folder level Alt+2
3. Search the Web Alt+3
4. Delete selected file Alt+4 or Delete
5. Create a new folder Alt+5
6. Cycle through all views Alt+6 repeatedly
7. Display the Tools menu Alt+7

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.13 secs.