Refreshing all pivot tables in workbook

G

Guest

Hi,

I'm trying to programmatically update all pivot tables in my workbook
without referring any one in particular.

The code that I have so far isn't working. Here is the code:

For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.PivotCache.Refresh
Next pt
Next ws

What am I doing wrong? When I run this code, it virtually freezed my file.
Eventually after an hour I believe it might work, but I was wondering if
there was more efficient code to do the trick.

Thanks,
Kent.
 
G

Guest

Hi Jim,

I integrated your code and the same thing happens. Excel is inoperable for
at least 20 minutes.... There has to be a reason why it practically hangs....
I'll post again tomorrow with the code.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top