Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pivottable not Refresh when run in the macro

Status
Not open for further replies.
Dec 23, 2004
33
US
I have about 10 pivot tables in Excel application. Only one pivot table does not refresh after I run the macro. However, if I put a stop in the marco, and run it manually...all pivot tables get updated. I've tried many times but I could not figure it out how this is possible. All the field names are the same during the process.

......
Sheets("Sheet1").select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
......

Thanks for your help.
Cogivina.
 
Check that that all PivotCache.BackgroundQuery are False and then try:
ActiveWorkbook.RefreshAll

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi PHV,

Thanks for reply my post. Even I'm new in this forrum (since Xmas), but I've read and learned so much from all of you. Thanks again, and have a great year to come.

The ActiveWorkbook.RefreshAll causes the application to run a little bit longer because it refreshes all the pivots in the workbook. The data is large and store in the access tables.

Once I filed my changes to the database. Two seperated macros will run to refresh two tables using PivotCache.Refresh. It works for one but not the other. I don't know why it does that.

Thanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top