Skip to main content

PivotCache object

Table of contents
  1. Remarks
  2. Example

Represents the memory cache for a PivotTable report.

Remarks

The PivotCache object is a member of the PivotCaches collection.

Example

Use the PivotCache method of the PivotTable object to return a PivotCache object for a PivotTable report (each report has only one cache).

The following example causes the first PivotTable report on the first worksheet to refresh itself whenever its file is opened.

Worksheets(1).PivotTables(1).PivotCache.RefreshOnFileOpen = True

Use PivotCaches (index), where index is the PivotTable cache number, to return a single PivotCache object from the PivotCaches collection for a workbook. The following example refreshes cache one.

ActiveWorkbook.PivotCaches(1).Refresh

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>