how to protect a sheet

  • Thread starter Thread starter youngman
  • Start date Start date
Y

youngman

hi,
i d like to protect my sheets.
i know there are many methods to do it,but i just want to do by setting

the property of the sheet to be -4142-xlnoselection.

but it comes to be of no result.

what is the problem.

thank you.
 
Activesheet.Protect Password:="ABCD:
ActiveSheet.EnableSelection = xlNoSelection

The EnableSelection property has to be set each time the workbook is opened
as it does not persist across the closing and opening of a workbook. You
might set it in the workbook_Open event or worksheet_Activate event or both.
 
thanks for your answer.
1."The EnableSelection property has to be set each time the workbook is
opened as it does not persist across the closing and opening of a workbook".
but why. is it a problem,or it is set to be so.
2.i don't want to protect my sheet with a macro,for it can be disable easily
when the file is opened.

thank you.
 
1. That is the way it works

2. Protection itself is persistent. If all cells are locked and you
protect the sheet, the user will not be able to enter any changes. It is
the enableselection property that is not persistent.

If you don't want to use it, that is certainly your choice.
 
thank you very much.
1. That is the way it works.
is there any merit in this point. in ordinary feeling,whenever we save a
file ,we can restore all property we want to have.
2. Protection itself is persistent. If all cells are locked and you
protect the sheet, the user will not be able to enter any changes. It is
the enableselection property that is not persistent.

once you run the macro you do protect the sheet,but when someone reads the
file in,it is simple to disable the macro.
anything wrong with my thinking.
regards

---------------------------------
 
Back
Top