Thread: Possible?
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Possible?

Left out the With statement

Private Sub Workbook_Open()
Worksheets("Sheet1").Activate
With worksheets("Sheet1").Cells
.Locked = True
.FormulaHidden = True
.Protect DrawingObjects:=True, _
Contents:=True, Scenarios:=True
.Parent.EnableSelection = xlNoSelection
End With
End Sub

--
Regards,
Tom Ogilvy


Tom Ogilvy wrote in message
...
Private Sub Workbook_Open()
Worksheets("Sheet1").Activate
worksheets("Sheet1").Cells
.Locked = True
.FormulaHidden = True
.Protect DrawingObjects:=True, _
Contents:=True, Scenarios:=True
.Parent.EnableSelection = xlNoSelection
End With
End Sub

--
Regards,
Tom Ogilvy


B. Wassen wrote in message
...
Tom,

It looks like this right now :

Private Sub Workbook_Open()

Selection.Locked = True
Selection.FormulaHidden = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,

Scenarios:=True

End Sub

But when I open Excel it gives an error at Selection.Locked = True


Ben