Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,075
- Office Version
- 2019
- Platform
- Windows
Is it possible to create a password for a user to have permanent, unrestricted access and not not be prompted for a password again?
What password are you talking about?
Opening the file, modifying the file, unprotecting the sheet or what?
Private Sub Workbook_Open()
If Environ("Username") <> "Dave" Then Exit Sub
Dim ws As Worksheet
For Each ws In ThisWorkbook.Sheets
ws.Unprotect "MyPassword"
Next
End Sub
Remember to create a lock scenario for Before_Close
KR
Dave
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Sheets
ws.Protect "MyPassword"
Next
End Sub
When you close the workbook you'll be wanting to lock to down
So
Code:Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim ws As Worksheet For Each ws In ThisWorkbook.Sheets ws.Protect "MyPassword" Next End Sub
This way when the user opens and then closes the workbook it is editable only to them
Is it possible to create a password for a user to have permanent, unrestricted access and not not be prompted for a password again?