Add Method (Arcs and Lines)

Applies To

Arcs Collection, Lines Collection.

Description

Creates a new arc or line.

Syntax

object.Add(x1, y1, x2, y2)

object

Required. The Arc or Line object.

x1, y1

Required. Specifies the position of the first coordinate of the object, in points (1/72 inch) relative to the top left corner of cell A1 or the upper left corner of the chart.

x2, y2

Required. Specifies the position of the second coordinate of the object, in points relative to the top left corner of cell A1 or the upper left corner of the chart.

See Also

Add Method (Drawings Collection), Add Method (DropDowns Collection), Add Method (Graphic Objects and Controls), Duplicate Method.

Example

This example creates a new line on Sheet1, with the arrowhead pointing to the upper left. Note the order of the points: the arrowhead points to the second coordinate.


With Worksheets("Sheet1").Lines.Add(80, 80, 10, 10)
    .ArrowHeadStyle = xlOpen
    .Border.LineStyle = xlDot
End With