Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Because the option to allowformattingcolumns wasn't introduced until xl2002.
It isn't supported in xl2000 and xl2000 knows nothing about the argument. -- Regards, Tom Ogilvy "AMK4" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2000 error message | New Users to Excel | |||
Excel 2000 error message | New Users to Excel | |||
Error 1004 in Excel 2000 | Excel Programming | |||
Solver error with Excel 2000? | Excel Programming | |||
vba excel 2000 device i/o error | Excel Programming |