[]
Updates the PivotTable cache from its source data.
Use this method after changing the cache source range to reload the cached records used by PivotTable reports that are based on this IPivotCache.
void Refresh()
Sub Refresh()
worksheet.Range["A1:B3"].Value = new object[,] {{"Region", "Sales"}, {"East", 120}, {"West", 150}};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B3"]);
pivotCache.CreatePivotTable(worksheet.Range["D1"]);
worksheet.Range["B3"].Value = 180;
pivotCache.Refresh();
| Type | Condition |
|---|---|
| InvalidOperationException | if the source sheet of the PivotCache cannot be found. |