+ Reply to Thread
Results 1 to 6 of 6

Run-time error '1004' ; AutoFilter Method of Range class failed

  1. #1
    Registered User
    Join Date
    11-18-2012
    Location
    Barcelona, España
    MS-Off Ver
    Excel 2003
    Posts
    3

    Run-time error '1004' ; AutoFilter Method of Range class failed

    Hello,
    I need your help.
    I have a macro that has been running daily for several years.
    Among the executed instructions, that should do it several times:

    Please Login or Register  to view this content.
    In the 5th execution, the compiler stops always at the command Selection.AutoFilter and show the message "Run-time error '1004 '; AutoFilter Method of Range class failed"
    After that, I do a reset of the macro:
    1. - On the sheet, the arrow has disappeared (Dropdown) and you can enable / disable the autofilter
    2. - Restart: fails on first run

    Finally, I have no solution to work with the latest backup, regenerating new version.
    What is the problem?
    Thanks for your help
    MAF
    Last edited by davesexcel; 11-18-2012 at 09:39 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Run-time error '1004' ; AutoFilter Method of Range class failed

    Hi and welcome to the forum,
    What is AÑOX?

  3. #3
    Registered User
    Join Date
    11-18-2012
    Location
    Barcelona, España
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Run-time error '1004' ; AutoFilter Method of Range class failed

    Tanks you
    I apologize the lack of translation
    "AÑOX" is an integer variable which means the current year (=YEAR(now())
    Best regards
    MAF

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Run-time error '1004' ; AutoFilter Method of Range class failed

    I just wanted to make sure it was a variable.

    Do you get the error if you set autofiltermode=false before you run autofilter?
    Please Login or Register  to view this content.
    Last edited by davesexcel; 11-18-2012 at 01:00 PM.

  5. #5
    Registered User
    Join Date
    11-18-2012
    Location
    Barcelona, España
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Run-time error '1004' ; AutoFilter Method of Range class failed

    Thanks for your proposal, davesexcel

    I've tried your suggestion; unfortunately, the code stopped again elsewhere
    I remember that this macro has worked for many years, every day.
    Now, in each execution of the Sub, it must run 25 times for the part of the code showed: fails to 5th.
    Now, when failure occurs:
    1.-Arrows autofilter disappear, in sheet "ENTRADA1"
    2.-In this sheet, the AutoFilter does not work manually
    3.- The macro recorder does not work.
    I test other changes: Before running this piece of code, I delete, add and move the worksheet "ENTRADA1" to a new workbook. I executed successfully this part of the code. However, the code fails to update a graph
    When I recover the last good backup and regenerate a new book, it works fine for 15 days
    My conclusion: The book is corrupted after 15 days and it’s not possible regenerate. How I can avoid this corruption?
    Best regards
    MAF

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Run-time error '1004' ; AutoFilter Method of Range class failed

    It is hard to tell without seeing it happen.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1