Protected Sheet Problem in Excel 2000

J

JG Scott

I have built an automated workbook application that contains the
following code:

Private Sub Workbook_Open()

On Error Resume Next

ThisWorkbook.Worksheets("Planning").Protect _
Password:="atom", UserInterfaceOnly:=True

ThisWorkbook.Worksheets("Planning").EnableSelection = xlUnlockedCells

ThisWorkbook.Worksheets("Sales").Protect _
Password:="atom", UserInterfaceOnly:=True

ThisWorkbook.Worksheets("Sales").EnableSelection = xlUnlockedCells

Application.ActiveWorkbook.Protect Password:="atom", Structure:=True

Sheets("Sales").Range("h3").Select

End Sub

It works fine for me, but another user can not see the cell border of
his selection highlighted on the "Planning" sheet. Does anyone know
why this would be and how to correct?

Thanks.

John Scott
 
T

Tom Ogilvy

I have seen that behavior and activating the sheet first before applying the
protection fixed it for me.

Private Sub Workbook_Open()

On Error Resume Next
Application.ScreenUpdating = False
With ThisWorkbook.Worksheets("Planning")
.Activate
.Protect _
Password:="atom", UserInterfaceOnly:=True
.EnableSelection = xlUnlockedCells
End With
With ThisWorkbook.Worksheets("Sales")
.Activate
.Protect _
Password:="atom", UserInterfaceOnly:=True
.EnableSelection = xlUnlockedCells
End With
Application.ThisWorkbook.Protect Password:="atom", Structure:=True

ThisWorkbook.Sheets("Sales").Range("h3").Select
Application.ScreenUpdating = True
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