Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unprotecting/protecting a spreadsheet with VB

Status
Not open for further replies.
May 24, 2005
30
US
I have a worksheet which is updated when I press a button. I have the code in the click event of that button. However if the worksheet is protected, the code cannot update the cells. I think I have to unprotect the sheet when I press the button and protect it again after the update. I need recommendations. Thanks in advance. By the way I am using excel 97.
 
Have a look at the Protect and Unprotect methods.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
when I add below codes, there is worksheet class error.

Activesheet.protect("abc")
or
Activesheet.protect() password:="abc"

 
And this ?
Activesheet.Protect "abc"
or
Activesheet.Protect Password:="abc"


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top