Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA Autofilter error in '97, not 2000

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default VBA Autofilter error in '97, not 2000

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default VBA Autofilter error in '97, not 2000

On Thu, 01 Apr 2004 21:28:35 -0600, Dave Peterson
wrote:

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


Thanks for this, but I have already tried it.
The problem occurs in two places.
Firstly in the Workbook_Open event and then later as a result of
comboboxes on the actual sheet.
Any further help is appreciated.

Foggy
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default VBA Autofilter error in '97, not 2000

I don't have a next guess.

You may want to post a few more lines of code.

Foggy wrote:

On Thu, 01 Apr 2004 21:28:35 -0600, Dave Peterson
wrote:

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


Thanks for this, but I have already tried it.
The problem occurs in two places.
Firstly in the Workbook_Open event and then later as a result of
comboboxes on the actual sheet.
Any further help is appreciated.

Foggy


--

Dave Peterson

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 Autofilter Error linglc Excel Discussion (Misc queries) 1 January 23rd 08 01:14 AM
Excel 2000 - Autofilter Limit NanoMark Excel Worksheet Functions 6 October 20th 06 12:35 AM
using autofilter in a shared protected workbook excel 2000? Needing Help for excel! Excel Discussion (Misc queries) 1 August 1st 06 06:24 PM
Using AutoFilter with worksheet protection in 2000 vs. 2003 gncook Excel Discussion (Misc queries) 3 July 25th 05 08:02 PM
how do i protect an Autofilter funtion on Excel 2000 Sincy Excel Worksheet Functions 1 June 17th 05 11:41 AM


All times are GMT +1. The time now is 02:05 AM.

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

About Us

"It's about Microsoft Excel"