Posted to microsoft.public.excel.programming
|
|
Excel 2000 error
AllowFormattingColumns is not valid in xl2000. I think it started in xl2002
(not sure)
--
HTH...
Jim Thomlinson
"AMK4" wrote:
Can someone explain to me why this fails in Excel 2000? They're getting
an error: *Microsoft Visual Basic Compile Error: Named Argument Not
Found*
Code:
--------------------
Private Sub Workbook_Open()
Dim wSheet As Worksheet
Application.ScreenUpdating = False
If Worksheets("MasterData").Visible = True Then
' MasterData is visible, keep everything veryhidden
For Each wSheet In Worksheets
wSheet.Unprotect Password:="cookies2006"
wSheet.EnableSelection = xlUnlockedCells
If wSheet.Name < "MasterData" Then
wSheet.Protect Password:="cookies2006", Contents:=True, UserInterfaceOnly:=True
wSheet.Visible = xlSheetVeryHidden
Else
wSheet.Protect Password:="cookies2006", Contents:=True, UserInterfaceOnly:=True, AllowFormattingColumns:=True
wSheet.Visible = xlSheetVisible
End If
Next
Else
' MasterData has been hidden, don't hide other sheets
For Each wSheet In Worksheets
If wSheet.Visible = True Then
' the sheet's not hidden, un/relock, don't hide
wSheet.Unprotect Password:="cookies2006"
wSheet.EnableSelection = xlUnlockedCells
wSheet.Protect Password:="cookies2006", Contents:=True, UserInterfaceOnly:=True
End If
Next
End If
Application.ScreenUpdating = True
End Sub
--------------------
--
AMK4
------------------------------------------------------------------------
AMK4's Profile: http://www.excelforum.com/member.php...o&userid=19143
View this thread: http://www.excelforum.com/showthread...hreadid=505475
|