R
rthomsen
Hi
I am trying to lock and unlock cells in an Excel 97 App via VB code. I
have the following function
Private Sub Workbook_Open()
ActiveSheet.Unprotect password:=Worksheets("sheet2").Range("PWD")
Worksheets("sheet1").Range("A1:BH22").Locked = True
Range("CompletedBy").Locked = False
ActiveSheet.Protect password:=Worksheets("Sheet2").Range("PWD"),
userinterfaceonly:=True
End Sub
Setting the Locked property works fine using a reference like "A1:B
H22" but fails when using a named range.
Does anyone have any idea why I cannot use a named range in this code.
I am trying to lock and unlock cells in an Excel 97 App via VB code. I
have the following function
Private Sub Workbook_Open()
ActiveSheet.Unprotect password:=Worksheets("sheet2").Range("PWD")
Worksheets("sheet1").Range("A1:BH22").Locked = True
Range("CompletedBy").Locked = False
ActiveSheet.Protect password:=Worksheets("Sheet2").Range("PWD"),
userinterfaceonly:=True
End Sub
Setting the Locked property works fine using a reference like "A1:B
H22" but fails when using a named range.
Does anyone have any idea why I cannot use a named range in this code.