How to prevent users from selecting cells in XL97

  • Thread starter Thread starter Marvin Hlavac
  • Start date Start date
M

Marvin Hlavac

Hi,

I created a spreadsheet in ExcelXP but when I put it on our work pc with
XL97 protected cells can be selected. Is there a way to correct this other
then upgrade XL?

Thanks a million in advance.
 
Martin

ExcelXP allows you to select many options when protecting a sheet.

Excel97 has very limited options in this regard.

To prevent the selection of protected cells in 97 you must use VBA.

Something like the following in Workbook_Open code for the entire workbook or
in worksheet_activate code for a particular worksheet when it is
activated......

ActiveSheet.EnableSelection = xlUnlockedCells
ActiveSheet.Protect Contents:=True

The EnableSelection property can be set to xlNoRestrictions, xlNoSelection, or
xlUnlockedCells. This property takes effect only when the worksheet is
protected: xlNoSelection prevents any selection on the sheet, xlUnlockedCells
allows only those cells whose Locked property is False to be selected, and
xlNoRestrictions allows any cell to be selected.

Gord Dibben Excel MVP
 
I created a spreadsheet in ExcelXP but when I put it on our work pc with
XL97 protected cells can be selected. Is there a way to correct this other
then upgrade XL?

On a tangential note, this is why it always makes sense to develop using the
*oldest* software configuration that could be used to run your application.
Nasty surprises tend to be fewer than happy surprises that way.
 
Martin

Glad to hear it.

I notice Ron de Bruin filled in the rest of the code in your other post with
same subject.

Gord
 
I notice Ron de Bruin filled in the rest of the code in your other post with
same subject.


Ron, I normally don't cross-post but at 6 am that day I posted this one and
since there was no reply in the afternoon I posted the other one.

Thanks again Ron.
 
Back
Top