ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Updating pivot tables after creating file (https://www.excelbanter.com/excel-programming/416429-updating-pivot-tables-after-creating-file.html)

ElPresidente

Updating pivot tables after creating file
 
Hi everyone,

I have a source workbook from which I'm extracting the data for a
given sales manager and saving the data under their own workbook name.
The pivot table is created from a template worksheet. So all I'm
really doing is just redefining the data range for the pivot table and
refreshing it. The problem is that if I try to double click a value to
get the drill-down, I get the following message:

The Pivot table report was saved without hte underlying data. Use the
Refresh Data command to update the report.

My VBA code is:

templateWb.WorkSheets("Pivots").PivotTables("Pivot Temp").ChangePivotCache
templateWb.PivotCaches.Create(SourceType:=xlDataba se,
SourceData:=pivotRange)

templateWb.WorkSheets("Pivots").PivotTables("Pivot Temp").PivotCache.Refresh
templateWb.SaveAs ....



All times are GMT +1. The time now is 05:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com