Parsing Pivot Cached Records while Loading an Excel File with Golang via C++

Possible Usage Scenarios

When you create a Pivot Table, Microsoft Excel takes a copy of the source data and stores it in the Pivot Cache. The Pivot Cache is held in memory by Microsoft Excel. You cannot see it, but that is the data the Pivot Table references when you build your Pivot Table, change a slicer selection, or move rows/columns around. This enables Microsoft Excel to be very responsive to changes in the Pivot Table, but it can also double the size of your file. After all, the Pivot Cache is just a duplicate of your source data, so it makes sense that your file size could potentially double.

When you load your Excel file into the Workbook object, you can decide whether you also want to load the Pivot Cache records, using the LoadOptions.GetParsingPivotCachedRecords() property. The default value of this property is false. If the Pivot Cache is quite large, it can improve performance. However, if you also want to load the Pivot Cache records, you should set this property to true.

Parsing Pivot Cached Records while Loading an Excel File

The following sample code demonstrates the usage of LoadOptions.GetParsingPivotCachedRecords() property. It loads the sample Excel file while parsing the pivot cached records, then refreshes the pivot table and saves it as the output Excel file.

Sample Code