PivotTables.Add Method
Adds a new PivotTable report. Returns a PivotTable object.
Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)
Syntax
'Declaration
Function Add ( _
PivotCache As PivotCache, _
TableDestination As Object, _
TableName As Object, _
ReadData As Object, _
DefaultVersion As Object _
) As PivotTable
'Usage
Dim instance As PivotTables
Dim PivotCache As PivotCache
Dim TableDestination As Object
Dim TableName As Object
Dim ReadData As Object
Dim DefaultVersion As Object
Dim returnValue As PivotTable
returnValue = instance.Add(PivotCache, _
TableDestination, TableName, ReadData, _
DefaultVersion)
PivotTable Add(
PivotCache PivotCache,
Object TableDestination,
Object TableName,
Object ReadData,
Object DefaultVersion
)
Parameters
PivotCache
Type: Microsoft.Office.Interop.Excel.PivotCacheRequired PivotCache. The PivotTable cache on which the new PivotTable report is based. The cache provides data for the report.
TableDestination
Type: System.ObjectRequired 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
Type: System.ObjectOptional Object. The name of the new PivotTable report.
ReadData
Type: System.ObjectOptional 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
Type: System.ObjectOptional Object. The version of Microsoft Excel the PivotTable was originally created in.
Return Value
Type: Microsoft.Office.Interop.Excel.PivotTable