Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Workbook.PivotCaches Method (2007 System)

Gets a PivotCaches collection that represents all the PivotTable caches in the specified workbook.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

public PivotCaches PivotCaches()

Return Value

Type: PivotCaches
A PivotCaches collection that represents all the PivotTable caches in the specified workbook.

The following code example uses the PivotCaches method to set each PivotCache in the current workbook to update automatically each time the workbook is opened.

This example is for a document-level customization.

private void WorkbookPivotCaches()
{
    Excel.PivotCaches caches = this.PivotCaches();

    if (caches != null)
    {
        for (int i = 1; i < caches.Count; i++)
        {
            caches[i].RefreshOnFileOpen = true;
        }
    }
}

Community Additions

ADD
Show:
© 2015 Microsoft