PivotTables.Add(PivotCache, Object, Object, Object, Object) Method

Definition

Adds a new PivotTable report. Returns a PivotTable object.

public Microsoft.Office.Interop.Excel.PivotTable Add (Microsoft.Office.Interop.Excel.PivotCache PivotCache, object TableDestination, object TableName, object ReadData, object DefaultVersion);

Parameters

PivotCache
PivotCache

Required PivotCache. The PivotTable cache on which the new PivotTable report is based. The cache provides data for the report.

TableDestination
Object

Required Object. The cell in the upper-left corner of the PivotTable report's destination range (the range on the worksheet where the resulting report will be placed). You must specify a destination range on the worksheet that contains the PivotTables object specified by expression.

TableName
Object

Optional Object. The name of the new PivotTable report.

ReadData
Object

Optional Object. True to create a PivotTable cache that contains all records from the external database; this cache can be very large. False to enable setting some of the fields as server-based page fields before the data is actually read.

DefaultVersion
Object

Optional Object. The version of Microsoft Excel the PivotTable was originally created in.

Returns

Applies to