I want to execute a bunch of functions, every time a refresh happens on the web query i have on the same excel file. The web query is fetching data every 10 mins and a pivot sits on the data.
How can i write a code in order to refresh the pivot every time the refresh happen automatically? So what i really need is -
OnRefresh() {
update pivot table
}
Thanks!
Use the following code
PivotCache.Refresh
For e.g.http://msdn.microsoft.com/en-us/library/office/ff195521%28v=office.15%29.aspx
You can substitute
1
withPivotTableName
if you like. Invoke this line in the event triggered by the web-page getting fetched or as the last line of the code doing the refresh.