Home » excel » Capture Excel Pivot Table Refresh event

Capture Excel Pivot Table Refresh event

Posted by: admin April 23, 2020 Leave a comment

Questions:

Is there an event corresponding to the data refresh of a pivot table?
I have found the

    worksheet_pivottableupdate

event but this seems to be called everytime I change filters or manipulate the pivottable (which is quite frequently with my macros). What I need is just to capture when the underlying data is updated. Any way to do this?

How to&Answers:

One way to tackle this is to use the pivottableupdate event, and combine it with checking that the following pivot-table property has changed.

PivotTables("PivotTable1").RefreshDate

See http://msdn.microsoft.com/en-us/library/ff834610(v=office.14).aspx for more information on the RefreshDate property.