+ Reply to Thread
Results 1 to 6 of 6

Macro Pivot Table Not Working for Certain Computer

  1. #1
    Registered User
    Join Date
    05-07-2019
    Location
    Nashville, TN
    MS-Off Ver
    2016
    Posts
    10

    Macro Pivot Table Not Working for Certain Computer

    Hello,

    We have a macro for use that involves creating pivot tables. The macro works just fine when I run it from my computer, but when a co-worker runs it exactly the same way (and I am there to make sure we are running it the same way), the macro errors out during the point where it starts to run pivot tables. Below is the code highlighted in yellow as the "error" on her end:

    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
    "Breakdown!R1C1:R1048576C4", Version:=6).CreatePivotTable TableDestination _
    :="Breakdown!R8C6", TableName:="PivotTable15", DefaultVersion:=6

    I cannot identify why this portion works for my computer, but not on hers (others also do not have the issue she is having).

    Thank you in advance for your help!

  2. #2
    Valued Forum Contributor
    Join Date
    12-22-2015
    Location
    HK
    MS-Off Ver
    2010
    Posts
    532

    Re: Macro Pivot Table Not Working for Certain Computer

    The specified version 6 is used in your code, try delete some code ", Version:=6"

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro Pivot Table Not Working for Certain Computer

    Hi,

    I agree with ikboy. My first guess would be different versions of Excel is the problem. What version does your coworker have? Second would be to insure they have the same named ranges on the correct sheets. Next might be you are trying to select a PivotTable15 that you have and they don't. Next I wonder if there version of Excel is older and doesn't support a million rows. What happens if you reduce the number of rows on the Breakdown sheet?

    Hope some of the above helps.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    05-07-2019
    Location
    Nashville, TN
    MS-Off Ver
    2016
    Posts
    10

    Re: Macro Pivot Table Not Working for Certain Computer

    Hello,

    I attempted to delete some of the code recommended above, and when I run the macro again, it errors out at that point. Is there maybe something I can put in place of the ", Version=6" insterad of deleting it?

    Thank you!

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro Pivot Table Not Working for Certain Computer

    Hi,

    I'd turn on the macro recorder and build a pivot table and then turn it off and see what code is recorded; on the machine that errors. I'd find the step similar to the code that words and replace that step in the code.

    I hope that makes sense. I still wonder if you aren't trying to pull too much into your pivot with the "Breakdown!R1C1:R1048576C4". This is a million rows and 4 columns. Does each column head have a different name that isn't blank? What happens if you change the above to Breakdown!R1C1:R1000C4"

    I really think if you record a macro and see what the VBA is doing is your best course of action.

  6. #6
    Registered User
    Join Date
    05-07-2019
    Location
    Nashville, TN
    MS-Off Ver
    2016
    Posts
    10

    Re: Macro Pivot Table Not Working for Certain Computer

    Hello,

    I don't want to change that number, because the number of values that could be submitted into the table, while maybe not a million) could reach upwards of a couple hundred thousand lines. I am thinking that the issue is the age of my colleague's computer, so I am hoping that there is something I can replace in the "version" section of the code to bypass an older version of Excel.

    Thank you!

+ 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. macro working on one not another computer
    By tigergutt in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-08-2018, 09:29 PM
  2. [SOLVED] Why isn't this code working? To run a macro when Pivot Table changes
    By Sophie.Durrant in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 06-02-2015, 04:12 AM
  3. [SOLVED] Pivot table macro not working and I'm at a lose as to why
    By punter in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-03-2014, 11:13 AM
  4. Pivot Table Filter Macro Not working
    By sm9748 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2013, 03:43 AM
  5. Refreshing pivot table macro does not work on a Mac computer.
    By prazad82 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-15-2013, 08:44 PM
  6. The Macro for refreshing the pivot table does not work on a Mac computer - Need Help
    By prazad82 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2013, 01:01 AM
  7. Macro for Pivot table not working properly
    By oakman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2007, 09:46 AM

Tags for this Thread

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