View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
SMonczka SMonczka is offline
external usenet poster
 
Posts: 33
Default How to refresh the data in a Pivot Table?

I decided to just rebuild the table on the fly using a macro. I
created a new table but when I run the macro it errors out ...

'make pivot table
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:=
_
"TableData").CreatePivotTable TableDestination:= _
"[Pivot_Report.xls]TABLE!R3C2",
TableName:="PivotTable1", DefaultVersion:= _
xlPivotTableVersion10

This line returns an error.
ActiveSheet.PivotTables("PivotTable1").AddFields
RowFields:=Array("Week", _
"Assigned to +", "Site Name +", "Cause Code", "Data")

Would you know why this would be? I should just be running the exact
same steps as I did when I made the macro.

Thanks again,
Steve