PivotCache.CreatePivotChart (Excel)

Creates a standalone PivotChart from a PivotCache object. Returns a Shape object.

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

CreatePivotChart (ChartDestination, XlChartType, Left, Top, Width, Height)


Workbooks("Book1").Connections.Add _
     "cubes4 Adventure Works DW 2008 Special Char Adventure Works", "", Array( _
     "OLEDB;Provider=MSOLAP.4;Integrated Security=SSPI;Persist Security Info=True;Data Source=;Initial Catalog=Adventure Works DW 2008" _
     , " Special Char"), Array("Adventure Works"), 1
   ActiveWorkbook.PivotCaches.Create(SourceType:=xlExternal, SourceData:= _
     ActiveWorkbook.Connections( _
     "cubes4 Adventure Works DW 2008 Special Char Adventure Works"), Version:= _
     xlPivotTableVersion14).CreatePivotChart(ChartDestination:="Sheet1").Select

   ActiveChart.ChartType = xlColumnClustered

Arguments

The following argument is required

ChartDestination (Worksheet) - The Destination worksheet.

Optional arguments

The following arguments are optional

XlChartType (XlChartType) - The type of chart.

Here you can find possible values for XlChartType

Left (Long) - 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 (Long) - The distance, in points, from the top edge of the topmost shape in the shape range to the top edge of the worksheet.

Width (Long) - The width, in points, of the object.

Height (Long) - The height, in points, of the object.