I have a spreadsheet that contains pivot tables, pivot table charts, xml map tables and etc.
I would like to have some control over which data should be refreshed and/or whether the data should be refreshed at all – for example the data in pivot tables, xml map tables or all the data in the whole workbook.
I looked at the ‘Object Browser’ in VBE but there is no event that pertains to the data refresh action.
Many thanks for your help,
You simply call the appropriate Refresh method.
Several objects have Refresh methods, i.e.
QueryTable
Chart
PivotCache
XmlDataBinding
You could also use Workbook.RefreshAll to refresh all external data ranges and PivotTables.
Search the VBA help for “refresh”.