akinkaraman Member Mar 3, 2015 #1 Macro button is not working in a Protected page.. Is there any solution to able the button in a Protected page?
Macro button is not working in a Protected page.. Is there any solution to able the button in a Protected page?
Hui Excel Ninja Staff member Mar 3, 2015 #2 In your code you have to Unprotect the worksheet the reprotect it again when finished You need something like this at the start: Code: SheetName.Unprotect Password:=yourPassword And this at the end: Code: SheetName.Protect Password:=yourPassword
In your code you have to Unprotect the worksheet the reprotect it again when finished You need something like this at the start: Code: SheetName.Unprotect Password:=yourPassword And this at the end: Code: SheetName.Protect Password:=yourPassword
akinkaraman Member Mar 3, 2015 #3 I am doing something wrong but I couldn't get it. It is crashing my Excel. Could you please check my file? The password of protected cells is 1234 Attachments Clock.xlsm Clock.xlsm 34.2 KB · Views: 2
I am doing something wrong but I couldn't get it. It is crashing my Excel. Could you please check my file? The password of protected cells is 1234
Hui Excel Ninja Staff member Mar 3, 2015 #4 Change the sub as shown below: Code: Sub Start_Clock() With Sheets("Clock") .Unprotect Password:="1234" .Range("C3").Value2 = Now .Protect Password:="1234" End With dtime = Now + TimeSerial(0, 0, 1) Application.OnTime dtime, "Start_Clock" End Sub or see attached Attachments Clock.xlsm Clock.xlsm 31.9 KB · Views: 6
Change the sub as shown below: Code: Sub Start_Clock() With Sheets("Clock") .Unprotect Password:="1234" .Range("C3").Value2 = Now .Protect Password:="1234" End With dtime = Now + TimeSerial(0, 0, 1) Application.OnTime dtime, "Start_Clock" End Sub or see attached
Hui Excel Ninja Staff member Mar 3, 2015 #6 because you have asked it to update every 1 second So every second it has to unprotect the worksheet Update the time Protect the worksheet do other stuff I'd try 2, 5 or 10 seconds
because you have asked it to update every 1 second So every second it has to unprotect the worksheet Update the time Protect the worksheet do other stuff I'd try 2, 5 or 10 seconds