Protect Sheet

T

Taurus

Hello,

I am running into a problem after I saved the protected worksheet.

Before I save the report, user are not allow to click on the cells or
fields that is protected.
After I save it, and re-open the xls, user is allow to click on the
cell or field that is protected but is not allow to edit. Is that the
behaviour of the excel?

I am using the below syntax:
ActiveSheet.Protect Password:="585", DrawingObjects:=True,
Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlUnlockedCells

Did anyone has the same issue?
 
J

JE McGimpsey

Taurus said:
ActiveSheet.EnableSelection = xlUnlockedCells

Did anyone has the same issue?

Yes. EnableSelection isn't saved with the workbook. You need to set it
every time the workbook opens. Put something like this in the
ThisWorkbook module:

Private Sub Workbook_Open()
Sheets(1).EnableSelection = xlUnlockedCells
End Sub
 

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