Share via


PivotCache.CreatePivotTable Method

Creates a PivotTable report based on a PivotCache object.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function CreatePivotTable ( _
    TableDestination As Object, _
    TableName As Object, _
    ReadData As Object, _
    DefaultVersion As Object _
) As PivotTable
'Usage
Dim instance As PivotCache
Dim TableDestination As Object
Dim TableName As Object
Dim ReadData As Object
Dim DefaultVersion As Object
Dim returnValue As PivotTable

returnValue = instance.CreatePivotTable(TableDestination, _
    TableName, ReadData, DefaultVersion)
PivotTable CreatePivotTable(
    Object TableDestination,
    Object TableName,
    Object ReadData,
    Object DefaultVersion
)

Parameters

  • TableDestination
    Type: System.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 PivotTable report will be placed). The destination range must be on a worksheet in the workbook that contains the PivotCache object specified by expression.

  • TableName
    Type: System.Object

    Optional Object. The name of the new PivotTable report.

  • ReadData
    Type: System.Object

    Optional Object. True to create a PivotTable cache that contains all of the 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.Object

    Optional Object. The default version of the PivotTable report.

Return Value

Type: Microsoft.Office.Interop.Excel.PivotTable

Remarks

For an alternative way to create a PivotTable report based on a PivotTable cache, see the Add method of the PivotTable object.

See Also

Reference

PivotCache Interface

PivotCache Members

Microsoft.Office.Interop.Excel Namespace