How to prevent users from selecting cells in XL97

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.
 
G

Gord Dibben

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
 
H

Harlan Grove

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.
 
G

Gord Dibben

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
 
M

Marvin Hlavac

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.
 

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