Table of Contents

Method Refresh

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

Refresh()

Computes the pivot table from its source again, as Excel's refresh does, and writes the result: its cache (shared items and records), its definition (location, items, row and column entries) and the cells it covers.

public void Refresh()

Remarks

Measured against Excel's own refresh (tools/Probe-ExcelPivots.ps1 -Refreshed): every value the same, in double; a new item after the items the table keeps, in the order the source first shows it; a field filtered by hand does not show an item it did not know. The cells the table covered before are cleared, and the new ones written from the location's top-left cell; their formats are left as they were.

Not refreshed (UnsupportedFeatureException): a table over an external or OLAP source, or one that uses a grouped field (dates grouped by months) or a calculated field.

Exceptions

InvalidOperationException

The pivot table was removed.

InvalidDocumentException

Its source, as the file states it, is not a range or a table of the workbook, or has no record.

UnsupportedFeatureException

The pivot table uses a source, a grouping or a calculated field that is not refreshed.

ResourceLimitExceededException

The source is larger than a refresh reads.