Edit

Share via


PivotCache.CreatePivotChart Method

Definition

Creates a standalone PivotChart from a PivotCache object. A Shape object is returned.

public Microsoft.Office.Interop.Excel.Shape CreatePivotChart (object ChartDestination, object XlChartType, object Left, object Top, object Width, object Height);
Public Function CreatePivotChart (ChartDestination As Object, Optional XlChartType As Object, Optional Left As Object, Optional Top As Object, Optional Width As Object, Optional Height As Object) As Shape

Parameters

ChartDestination
Object

The Destination worksheet

XlChartType
Object

The type of chart

Left
Object

The distance, in points, from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).

Top
Object

The distance, in points, from the top edge of the topmost shape in the shape range to the top edge of the worksheet.

Width
Object

The width, in points, of the object.

Height
Object

The width, in points, of the object.

Returns

Remarks

If the PivotCache object that the method is called from has no attached PivotTable:

  • A workbook-level PivotTable is created from the existing PivotCache.
  • A standalone PivotChart will be created with a reference to the newly created PivotTable.

If the PivotCache already has an associated PivotTable:

  • The PivotCache is cloned
  • A new workbook-level PivotTable is created based on the cloned PivotCache.
  • A standalone PivotChart is created with a reference to the new workbook-level PivotTable.

Applies to