Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel97 - Worksheet Protection Question
Trying to create a form for users which is locked until they press a button
to enter values. I'm having a problem getting the worksheet to unlock so I can set a range for data entry then lock again. Code fragment is: Worksheets(WkShtName).Unprotect Worksheets(WkShtName).Range("B3").Locked = False Worksheets(WkShtName).Protect When I try to test this I get an "Error 1004 Unprotect Method of Worksheet Class failed" on the first line if the Worksheet is locked, and "unable to set the Locked property of the Range class" if the sheet is unlocked when I invoke the code. Stranger still, the code is invoked from a button handler - if I use the button I get error above, but if I run the code under the VBA Editor, then it runs OK IF the worksheet is unprotected..hmmm Can anyone point me in the right direction to make this work please Thanks Russell |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Worksheet Protection Question | Excel Discussion (Misc queries) | |||
Worksheet protection question | Excel Discussion (Misc queries) | |||
A Worksheet Protection Question | New Users to Excel | |||
Excel97 Question?? | Excel Discussion (Misc queries) | |||
question about worksheet protection using userinterfaceonly:=true | Excel Programming |