LucaGiorgio
New Member
- Joined
- Jun 14, 2017
- Messages
- 4
Hi All,
First post here so apologies if I miss something out or do something wrong!
I have created an automated unlocker and locker for my MI reports to make it quicker for me to change the report from clients restricted view to my opened view which consist of the below. My only annoyance is that I am unable to write or find anything to do with unprotecting the VBA password like the 'ActiveSheet.Unprotect Password:="Password"' does. I am looking for something like VBAProject.Unprotect Password:="Password". Can anyone help?
-----------------------------------------------------------------------------------------
First post here so apologies if I miss something out or do something wrong!
I have created an automated unlocker and locker for my MI reports to make it quicker for me to change the report from clients restricted view to my opened view which consist of the below. My only annoyance is that I am unable to write or find anything to do with unprotecting the VBA password like the 'ActiveSheet.Unprotect Password:="Password"' does. I am looking for something like VBAProject.Unprotect Password:="Password". Can anyone help?
-----------------------------------------------------------------------------------------
Code:
Sub Unlocker()
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
Application.Calculation = xlCalculationAutomatic
ActiveSheet.Unprotect Password:="Password"
ActiveWorkbook.Unprotect Password:="Password"
ActiveWindow.DisplayWorkbookTabs = True
Sheets("Arrays").Visible = True
Sheets("Utilisation").Visible = True
Sheets("Speeding").Visible = True
Sheets("Harsh Incidents").Visible = True
Sheets("Trips Data").Visible = True
Sheets("Trend Data").Visible = True
Application.ScreenUpdating = True
Application.DisplayStatusBar = True
End Sub
-----------------------------------------------------------------------------------------
Sub Locker()
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
Sheets("Arrays").Visible = xlVeryHidden
Sheets("Utilisation").Visible = xlVeryHidden
Sheets("Speeding").Visible = xlVeryHidden
Sheets("Harsh Incidents").Visible = xlVeryHidden
Sheets("Trips Data").Visible = xlVeryHidden
Sheets("Trend Data").Visible = xlVeryHidden
ActiveSheet.Protect Password:="Password"
ActiveWorkbook.Protect Password:="Password", Structure:=True, Windows:=False
ActiveWindow.DisplayWorkbookTabs = False
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = True
Application.DisplayStatusBar = True
End Sub
Last edited by a moderator: