DrawingObjects Method

Applies To

Chart Object, DialogSheet Object, Worksheet Object.

Description

Accessor. Returns an object that represents a single drawing object (Syntax 1) or a collection of all the drawing objects (Syntax 2) on the sheet. Returns all drawing objects, including graphic objects, pictures, embedded objects, and embedded charts.

Syntax 1

object.DrawingObjects(index)

Syntax 2

object.DrawingObjects

object

Required. The Chart, DialogSheet, or Worksheet object.

index

Required for Syntax 1. The name or number of the drawing object. Can be an array to return several drawing objects.

See Also

DrawingObjects Collection.

Example

This example deletes drawing object three on Sheet1.


Worksheets("Sheet1").DrawingObjects(3).Delete

This example deletes every drawing object on Sheet1.


Worksheets("Sheet1").DrawingObjects.Delete

This example adds arrowheads to every graphic object on Sheet1 that has the word "Line" in its name.


For Each d In Worksheets("Sheet1").DrawingObjects
    If d.Name Like "*Line*" Then
        d.ArrowHeadLength = xlLong
        d.ArrowHeadStyle = xlOpen
        d.ArrowHeadWidth = xlNarrow
    End If
Next