Share via


PivotCaches.Create Method

Creates a new PivotCache.

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

Syntax

'Declaration
Function Create ( _
    SourceType As XlPivotTableSourceType, _
    SourceData As Object, _
    Version As Object _
) As PivotCache
'Usage
Dim instance As PivotCaches
Dim SourceType As XlPivotTableSourceType
Dim SourceData As Object
Dim Version As Object
Dim returnValue As PivotCache

returnValue = instance.Create(SourceType, _
    SourceData, Version)
PivotCache Create(
    XlPivotTableSourceType SourceType,
    Object SourceData,
    Object Version
)

Parameters

Return Value

Type: Microsoft.Office.Interop.Excel.PivotCache
PivotCache

Remarks

The following two XlPivotTableSourceType constants are not supported when using this method: xlPivotTable and xlScenario. A run-time error is returned if one of these two constants is supplied.

The SourceData argument is required if SourceType isn't xlExternal. It can be a Range object (when SourceType is either xlConsolidation or xlDatabase) or an Excel WorkbookConnection object (when SourceType is xlExternal).

When not supplied, the version of the PivotTable will be xlPivotTableVersion12. The use of the xlPivotTableVersionCurrent constant is not allowed and returns a run-time error if it is supplied.

See Also

Reference

PivotCaches Interface

PivotCaches Members

Microsoft.Office.Interop.Excel Namespace