joefrench
Active Member
- Joined
- Oct 4, 2006
- Messages
- 357
I have many sheets that run macros which need the password protection to be lifted while running certain portions of the macros. Does anyone know of a way to pull the password from a cell on a hidden sheet? I have tried the following:
And:
Neither of which worked.
You're help is greatly appreciated!
EDIT: Changed to Code Tags - Smitty
Code:
Dim pw As String
Set pw = Sheet3.Range("a3")
ActiveSheet.Unprotect Password:=pw
ActiveSheet.Publish_Button.Visible = False
ActiveSheet.Print_Button.Visible = False
Auto_republish
ActiveSheet.Publish_Button.Visible = True
ActiveSheet.Print_Button.Visible = True
ActiveSheet.Protect Password:=pw, userinterfaceonly:=True
send_msg
And:
Code:
ActiveSheet.Unprotect Password:=Sheet3.Range("a3").Value
ActiveSheet.Publish_button.Visible = False
ActiveSheet.Print_Button.Visible = False
AutoRepublish
ActiveSheet.Publish_button.Visible = True
ActiveSheet.Print_Button.Visible = True
ActiveSheet.Protect Password:=Sheet3.Range("a3").Value, _
userinterfaceonly:=True
send_msg
Neither of which worked.
You're help is greatly appreciated!
EDIT: Changed to Code Tags - Smitty