Version

Add(PredefinedShapeType,Rect) Method

Adds a predefined shape to the collection with the specified bounds.
Syntax
'Declaration
 
Public Overloads Function Add( _
   ByVal shapeType As PredefinedShapeType, _
   ByVal boundsInTwips As Rect _
) As WorksheetShape

Parameters

shapeType
The type of shape to add to the collection.
boundsInTwips
The bounds of the shape on the Worksheet in twips (1/20th of a point).

Return Value

A WorksheetShape-derived instance representing the predefined shape.
Exceptions
ExceptionDescription
System.InvalidOperationExceptionThis shapes collection belongs to a WorksheetShapeGroup which isn't placed on a Worksheet yet. In this case, call Add(PredefinedShapeType,Sheet,Rect) instead and specify the Worksheet where the group will be added.
System.ComponentModel.InvalidEnumArgumentExceptionshapeType is not defined in the PredefinedShapeType enumeration.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also