Refresh Table method of PivotTable class failed - on macro run, not always on macro step

Important Notice


Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.

  • I am developing a macro to locate pivot table errors. It lists all pivot tables in a workbook with associated error messages. When I run it, each pivot table fails with the message "RefreshTable method of PivotTable class failed" unless another error had occurred with its own message. However, if I step through the macro, this message does not appear, and the refreshes complete OK.

    What's causing the message?

  • Hi,


    Difficult to guess your specific environment ...


    Strictly speaking ... you should never have " pivot tables errors "


    What could have an influence is your Application.Calculation mode, the workbook protection, the number of pivot caches, etc ...


    In terms of expertise ... the best expert on Planet Earth is Debra


    https://contextures.com/excelpivottableerrors.html


    Hope this will help

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Hi Carim

    If you can avoid pivot table errors when you have hundred of PTs you're a marvel.

    Another is Debra, to whom you refer. I have used her code to help find pivot tables in error, extending it to pin down the specific table rather than just identifying others in the same rows or columns for overlap problems. Still de-bugging it, but its looking good.

    Still haven't solved "RefreshTable method of PivotTable class failed".

    Peter

  • Hi,


    In my humble opinion, it is not so much the thousands of Pivot tables you are dealing with ...

    but the number of pivot caches you should optimize ...

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Hi Carim

    Optimnising caches is the very thing that makes it had to locate pivot table errors, as an error in any pivot table sharing a cache affects all the others. My solution is to shift all pivot tables to separate caches, locate and fix any errors, then recombine them to optimise the caches.

    Peter

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!