Unprotect Sheet - Removal of standard Message

D

Darin Kramer

Howdie,

I have a protected sheet, but with no password supplied. When a user
clicks on a protected Celle he gets the standard msg that says " Sheet
is protected, go to the unprotect sheet option under the tools menu....)

I dont want the user to see that - just want him to see - Sheet is
protected values can not be changed.

Is that possible?

Thanks

D


*** Sent via Developersdex http://www.developersdex.com ***
 
N

NickHK

Darin,
Not perfect, but the BeforeDoubleClick event will give you chance to:

If Target.Locked = True Then
MsgBox "can't edit: locked"
Cancel = True
End If

NickHK
 
T

Tom Ogilvy

wouldn't that just work if the user double clicked (an unlikely event)?
Not sure that saying "Not perfect" captures the full essence of that
constraint <g>
 
N

NickHK

The OP said that "when a user clicks on a protected cell.."
A single click would not have an effect on a locked cell, whereas a double
click would.
Just following that line of thought.

NickHK
 
T

Tom Ogilvy

Pragmatically, I can't recall double clicking on a cell recently. Click
once and type, then get the message for a protected cell is the normal mode
for me.

But it is certainly true your solution handles the double click; thus I
applaud your creativity.

I previously suggested (a previous thread) the OP use the enableselection
property which was apparently rejected, so I am not just "butting" in or
giving you a hard time. I just want it to be clear to the OP that what you
suggest is not going to eliminate many of the messages unless the habits of
his users are to only double click.

Anyway, if event code is the answer, then might as well use selectionchange
perhaps in conjunction with your offering.

Regards,
Tom Ogilvy
 
N

NickHK

Tom,
The .EnableSelection would be a more robust way of preventing the message,
agreed.
Alternatively, the OP should allow Excel to do its thing.

NickHk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top