ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatic Refresh for Pivot Table (https://www.excelbanter.com/excel-programming/328207-re-automatic-refresh-pivot-table.html)

Glenn Ray[_3_]

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



Carim[_3_]

Automatic Refresh for Pivot Table
 
Glenn,

Thanks a lot for your input.
But it would appear that, in fact, any event does not fire if an object
is in the sheet and if the routine comes back from another workbook ...
I am still working this out
Cheers


Carim[_3_]

Automatic Refresh for Pivot Table
 
Hi,

For the sake of completion, one has to fire this type from the other
workbook i.e. use application.run from the second workbook.
Cheers



All times are GMT +1. The time now is 11:16 PM.

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