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

  • Left
    Type: System.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
    Type: System.Object

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

  • Height
    Type: System.Object

    The 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.

See Also

Reference

Shapes Interface

Shapes Members

Microsoft.Office.Interop.Excel Namespace