Hello,
I have a workbook that has several buttons that are created on workbook open. Each button runs a macro that changes an AutoFilter value of a column. The project was created in Excel 2000, where all works fine. I am having a problems with users who have Excel 97 - when they click on some (not all (!!)) buttons, they get the error message "RunTime Error '1004' AutoFilter method of RangeClass failed".
Everything works fine in Excel 2000 and some of the code works fine in Excel 97. I'm LOST!
What gives? Some sample code below.
Thanks for any thoughts / solutions.
Chris York
Sub TR35()
Application.ScreenUpdating = False
'Resets all Filters to "All"
Run "Clear"
'Sets TR NPR (00-01) to "<=35"
Application.ScreenUpdating = False
Worksheets("StudentData").Select
Selection.AutoFilter , Field:=21, Criteria1:="<=35.0"
Range("A1").Select
End Sub
Sub Clear()
Application.ScreenUpdating = False
Worksheets("StudentData").Select
'Show Print Filters
Columns("E:G").Select
Selection.EntireColumn.Hidden = False
Columns("J:W").Select
Selection.EntireColumn.Hidden = False
'Shows TR Columns
Worksheets("StudentData").Select
Columns("X:AA").Select
Selection.EntireColumn.Hidden = False
Columns("AF:AI").Select
Selection.EntireColumn.Hidden = False
Columns("AN:AQ").Select
Selection.EntireColumn.Hidden = False
Range("A1").Select
Application.ScreenUpdating = True
On Error GoTo Skip
Worksheets("StudentData").Select
Worksheets("StudentData").ShowAllData
Worksheets("StudentData").Select
Skip:
'Application.CalculateFull
Range("A1").Select
End Sub
I have a workbook that has several buttons that are created on workbook open. Each button runs a macro that changes an AutoFilter value of a column. The project was created in Excel 2000, where all works fine. I am having a problems with users who have Excel 97 - when they click on some (not all (!!)) buttons, they get the error message "RunTime Error '1004' AutoFilter method of RangeClass failed".
Everything works fine in Excel 2000 and some of the code works fine in Excel 97. I'm LOST!
What gives? Some sample code below.
Thanks for any thoughts / solutions.
Chris York
Sub TR35()
Application.ScreenUpdating = False
'Resets all Filters to "All"
Run "Clear"
'Sets TR NPR (00-01) to "<=35"
Application.ScreenUpdating = False
Worksheets("StudentData").Select
Selection.AutoFilter , Field:=21, Criteria1:="<=35.0"
Range("A1").Select
End Sub
Sub Clear()
Application.ScreenUpdating = False
Worksheets("StudentData").Select
'Show Print Filters
Columns("E:G").Select
Selection.EntireColumn.Hidden = False
Columns("J:W").Select
Selection.EntireColumn.Hidden = False
'Shows TR Columns
Worksheets("StudentData").Select
Columns("X:AA").Select
Selection.EntireColumn.Hidden = False
Columns("AF:AI").Select
Selection.EntireColumn.Hidden = False
Columns("AN:AQ").Select
Selection.EntireColumn.Hidden = False
Range("A1").Select
Application.ScreenUpdating = True
On Error GoTo Skip
Worksheets("StudentData").Select
Worksheets("StudentData").ShowAllData
Worksheets("StudentData").Select
Skip:
'Application.CalculateFull
Range("A1").Select
End Sub