Hi

I have Pivot Tables connected to a data source on one sheet and corresponding pivot charts on another sheet.
I need a macro to be able to update the charts without making the tables visible to the user.

I need the Charts sheet to be Active at all times.
I recorded the following macro for the same, but receive an error when I run it.
"Unable to get Pivot Table property of the Worksheet class"

ActiveSheet.ChartObjects("Chart 6").Activate
ActiveSheet.PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables( _
"PivotTable1").CubeFields("[Measures].[Total Overall time]")

As of now I use the following macro

Sheets("Pivots").Select
Sheets("Pivots").PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables( _
"PivotTable1").CubeFields("[Measures].[Total Overall time]")
Sheets("Charts").Select

In this case, the user sees the control being transferred to Sheet with Pivot table and then back to the Charts Sheet.
Please let me know if the macro can update the table in the background, so that the user only sees the charts being updated.

Thanks in advance