Skip to content

Latest commit

 

History

History
54 lines (28 loc) · 1.42 KB

f2186af3-c28a-4196-a00e-00cc66d28f71.md

File metadata and controls

54 lines (28 loc) · 1.42 KB

Shapes.AddLine Method (Excel)

As it applies to the Shapes object, returns a Shape object that represents the new line in a worksheet.

Syntax

expression . AddLine( BeginX , BeginY , EndX , EndY )

expression A variable that represents a Shapes object.

Parameters

Name Required/Optional Data Type Description
BeginX Required Single The position (in points) of the line's starting point relative to the upper-left corner of the document.
BeginY Required Single The position (in points) of the line's starting point relative to the upper-left corner of the document.
EndX Required Single The position (in points) of the line's end point relative to the upper-left corner of the document.
EndY Required Single The position (in points) of the line's end point relative to the upper-left corner of the document.

Return Value

Shape

Example

This example adds a blue dashed line to myDocument.

Set myDocument = Worksheets(1) 
With myDocument.Shapes.AddLine(10, 10, 250, 250).Line 
 .DashStyle = msoLineDashDotDot 
 .ForeColor.RGB = RGB(50, 0, 128) 
End With

See also

Concepts

Shapes Object

Other resources

Shapes Object Members