Shapes.AddChart Method
Creates a chart at the specified location on the active sheet.
Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)
Syntax
'Declaration
Function AddChart ( _
XlChartType As Object, _
Left As Object, _
Top As Object, _
Width As Object, _
Height As Object _
) As Shape
'Usage
Dim instance As Shapes
Dim XlChartType As Object
Dim Left As Object
Dim Top As Object
Dim Width As Object
Dim Height As Object
Dim returnValue As Shape
returnValue = instance.AddChart(XlChartType, _
Left, Top, Width, Height)
Shape AddChart(
Object XlChartType,
Object Left,
Object Top,
Object Width,
Object Height
)
Parameters
XlChartType
Type: System.ObjectThe chart type.
Left
Type: System.ObjectThe 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
Type: System.ObjectThe distance, in points, from the top edge of the topmost shape in the shape range to the top edge of the worksheet.
Width
Type: System.ObjectThe width, in points, of the object.
Height
Type: System.ObjectThe height, in points, of the object.
Return Value
Type: Microsoft.Office.Interop.Excel.Shape
Shape
Remarks
If the chart type is omitted, the default chart type for the application is used. If the position is omitted, the default size for the application is used.