#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Protection

Janet

ActiveSheet.Unprotect Password:="drowssap"

ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True, Password:="drowssap"

You don't say what your problem is. Is it with changing the data or the
protection/unprotection ?

Regards

Trevor

"janet" wrote in message
...
I am working in a protected worksheet and when a radio
button is selected, it should unprotect the Sheet, Change
values in Cells and re-protect. I can't get the syntax
correct. I thought it should be

ActiveSheet.Unprotect Password:="password"

Then select the range, change and re-protect.






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Protection

Getting the Error Message

Runtime Error 1004

Unprotect Method of Worksheet class failed.
-----Original Message-----
Janet

ActiveSheet.Unprotect Password:="drowssap"

ActiveSheet.Protect DrawingObjects:=True,

Contents:=True,
Scenarios:=True, Password:="drowssap"

You don't say what your problem is. Is it with changing

the data or the
protection/unprotection ?

Regards

Trevor

"janet" wrote in message
...
I am working in a protected worksheet and when a radio
button is selected, it should unprotect the Sheet,

Change
values in Cells and re-protect. I can't get the syntax
correct. I thought it should be

ActiveSheet.Unprotect Password:="password"

Then select the range, change and re-protect.






.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Protection

Are you running xl97?

If yes, add:

activecell.activate

at the top of your code.

(For controls that have a .takefocusonclick property, you can change that to
false.)

(This is a bug that was fixed in xl2k.)



janet wrote:

Getting the Error Message

Runtime Error 1004

Unprotect Method of Worksheet class failed.
-----Original Message-----
Janet

ActiveSheet.Unprotect Password:="drowssap"

ActiveSheet.Protect DrawingObjects:=True,

Contents:=True,
Scenarios:=True, Password:="drowssap"

You don't say what your problem is. Is it with changing

the data or the
protection/unprotection ?

Regards

Trevor

"janet" wrote in message
...
I am working in a protected worksheet and when a radio
button is selected, it should unprotect the Sheet,

Change
values in Cells and re-protect. I can't get the syntax
correct. I thought it should be

ActiveSheet.Unprotect Password:="password"

Then select the range, change and re-protect.






.


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Data Protection Best Practice: AKA: Real Sheet Protection Mushman(Woof!)[_2_] Excel Discussion (Misc queries) 4 December 30th 09 01:20 AM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
WS Protection: Different Levels of Protection on Different Ranges Carmi Excel Discussion (Misc queries) 4 August 31st 07 02:26 PM
Cell Protection vs. Worksheet Protection kmwhitt Excel Discussion (Misc queries) 4 September 24th 06 02:37 AM
Worksheet protection is gone and only wokbook protection can be se Eric C. Excel Discussion (Misc queries) 4 May 2nd 06 04:50 PM


All times are GMT +1. The time now is 04:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"