protected cells can be deleted?!

  • Thread starter Thread starter DannyS
  • Start date Start date
D

DannyS

I have a protect macro that runs whenever the workbook is opened and this
works well whenever a user attempts to overwrite a locked cell. However, if
the user just selects a locked cell then hits the delete key the cell is
deleted!

My macro is as follows:

Sub Auto_Open()

Dim wks As Worksheet

For Each wks In Worksheets
With wks
.Protect Password:="Password", userinterfaceonly:=True
.EnableOutlining = True
End With
Next wks

ActiveWorkbook.Protect Password:="Password", Structure:=True, Windows:=False

End Sub

Any ideas how I can stop locked cells being deleted?

Thanks so much in advance!
 
Are you sure that the cell that they're clearing is locked.

You have to lock the cell (format|cells|protection tab), then protect the
worksheet (tools|protection|protect sheet) to stop what you're seeing.

I'd double check that locked status if I were you.
 
Yes, I am certain. I can be sure as when I try to type in the cell I get the
standard 'This cell is locked and protected' pop up.
 
Since you've double checked the lockedness of the cell, the only thing that I
can think of is that maybe there's a macro that's stolen the delete key.

The delete key now executes a macro and with "userinterfaceonly:=True", it can
do pretty much what it wants.

One more guess...

Is this cell merged with other cells?
 
Nope, no merged cells. It is not one cell, it is all (locked) cells.

I think I need the userinterfaceonly=true line as I have a number of grouped
and outlined rows that the user needs to maximise and minimise.
 
Any macro that steals the delete key?
Nope, no merged cells. It is not one cell, it is all (locked) cells.

I think I need the userinterfaceonly=true line as I have a number of grouped
and outlined rows that the user needs to maximise and minimise.
 
It could still be a macro--you haven't commented on that.

But...

If you create a new workbook and set it up the same way, do you have the same
results?

If you create a new worksheet in the same workbook and test it, do you have the
same results?

If you open excel in safe mode:

Close excel
windows start button|run
excel /safe
file|open your workbook
and test it out, does it work ok?

Opening excel in safe mode will disable macros.

Nope.

I think it might be a bug?
 
Back
Top