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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sheet protection > Protect from editing, leaving it open for vba?

Status
Not open for further replies.

IndigoDragon

Programmer
Aug 2, 2005
57
NL
Hi everyone,

[Excel]
Is there a way to protect a sheet from being edited directly by a user, even hiding it, but still being able to edit the data in the sheet through vba?

ThanX for your replies!
 
You can set the Visible property to 2 (Very Hidden), this way the user can not unhide the sheet.

You can always protect the sheet with a password and unprotect the sheet in your VBA before you do any amendments to it.
 
Have a look at the UserInterfaceOnly property of the Protection method - this allows exactly that - to the user, it appears protected but code can run on the sheet as if it were not

Needs to be set every time the workbook is opened however as it resets when the workbook is closed - it therefore needs to be coded in the Workbook_Open event

Rgds, Geoff

Three things are certain. Death, taxes and lost data. DPlank is to blame

Please read FAQ222-2244 before you ask a question
 
no probs !

Rgds, Geoff

Three things are certain. Death, taxes and lost data. DPlank is to blame

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top