Whenever I see the 1004 error with words that say it worked in xl2k, but not
xl97, I think of code being run from a control on the worksheet from the
ControlToolbox toolbar. (Like a commandbutton).
If that describes your situation, then try changing the .takefocusonclick
property of that control to False.
If the control you're using doesn't have that property, then add this line near
the top of your code:
activecell.activate
Foggy wrote:
I have a VBA Excel macro which runs happily in Office 2000 but falls
over with the 1004 error ("Autofilter method of Range Class Failed")
in Office 97 (SR 2)
The code in question is
Sheets(3).Range("A4")..AutoFilter , _
field:=7, _
Criteria1:= "*Open*"
This works fine in Office 2000, but all users still using Office 97
report this error (tried both NT and W2K OS's)
I have tried the MS KB and have trawled the web and usenet for a
couple of days now but I have found no solution.
Can anyone help?
TIA
Foggy
--
Dave Peterson