Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2000 error


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel 2000 error

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2000 error message Bill New Users to Excel 3 January 4th 07 06:41 PM
Excel 2000 error message Bill New Users to Excel 0 January 4th 07 02:50 PM
Error 1004 in Excel 2000 YaakovSinai Excel Programming 0 April 18th 04 03:46 PM
Solver error with Excel 2000? Dana DeLouis[_5_] Excel Programming 3 August 14th 03 06:15 AM
vba excel 2000 device i/o error pete Excel Programming 0 August 4th 03 09:38 PM


All times are GMT +1. The time now is 10:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"