View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Glenn Ray[_3_] Glenn Ray[_3_] is offline
external usenet poster
 
Posts: 34
Default Automatic Refresh for Pivot Table

It may be that the PivotTable is no longer identified as item (1).

Right-click on the PivotTable and select "Table Options..." from the
shortcut menu. Note the name listed in the "Name:" field on top and then
replace the "1" in your code to the PivotTable name in quotes.

Ex.
Private Sub Worksheet_Activate()
ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh
End Sub


-Glenn Ray


"Carim" wrote:

Hi,

After some data update in the source file (separate file), I would like
an automatic refresh of pivot table.
I am using the following code :
Private Sub Worksheet_Activate()
ActiveSheet.PivotTables(1).PivotCache.Refresh
End Sub
What 's wrong ? Any ideas ?
TIA
Carim