+ Reply to Thread
Results 1 to 3 of 3

Run time error '1004' on changing pivot table filter line of code

  1. #1
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Run time error '1004' on changing pivot table filter line of code

    I am using the following code to change the open a file, changing the a pivot table filter and copy the data to my master worksheet. The problem is that is throwing an error the line of changing the filter value, marked in red in the code.
    The strange thing is that I am using the exact same code for a different file and it works properly. I verified and all the variables are declared properly. The worksheets are unprotected as well.
    Why is working for another file, but not this one?

    Please Login or Register  to view this content.
    Last edited by PaulM100; 11-28-2019 at 05:43 AM.
    Click the * to say thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: Run time error '1004' on changing pivot table filter line of code

    Hi Paul,

    Maybe the error occurs because the NewCat page does not exist and the pivot table is filtering more than one page.

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Run time error '1004' on changing pivot table filter line of code

    Thank you, but I found the problem. I have some OLAP connections for th pivot tables and these haven't been refreshed, the division change failing. Strange one anyway.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Filter pivot table based on named range - Error 1004
    By Upset in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-11-2015, 05:42 AM
  2. [SOLVED] Run time error 1004 - why is the last line of this code causing this?
    By SweetSorcery in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 07-14-2014, 06:57 AM
  3. Run time error '1004' when populating pivot table
    By Orongo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2012, 07:29 AM
  4. Unable to set pivot filter via code: error 1004
    By tlafferty in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-08-2012, 02:55 AM
  5. Run-time error 1004 in Pivot Table
    By NMullis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-28-2008, 06:30 PM
  6. Run Time Error 1004, Pivot table
    By keshav in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2007, 10:01 AM
  7. [SOLVED] Pivot Table Run Time Error 1004
    By Dale in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-03-2006, 11:50 AM

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