Version

Add(PredefinedShapeType,WorksheetCell,PointF,WorksheetCell,PointF) Method

Adds a predefined shape to the collection with the specified anchors.
Syntax

Parameters

shapeType
The type of shape to add to the collection.
topLeftCornerCell
The cell where the top-left corner of the shape resides.
topLeftCornerPosition
The position in the topLeftCornerCell of the shape's top-left corner, expressed in percentages.
bottomRightCornerCell
The cell where the bottom-right corner of the shape resides.
bottomRightCornerPosition
the position in the bottomRightCornerCell of the shape's bottom-right corner, expressed in percentages.

Return Value

A WorksheetShape-derived instance representing the predefined shape.
Exceptions
ExceptionDescription
System.ComponentModel.InvalidEnumArgumentExceptionshapeType is not defined in the PredefinedShapeType enumeration.
System.InvalidOperationExceptiontopLeftCornerCell or bottomRightCornerCell is null.
System.InvalidOperationExceptiontopLeftCornerCell and bottomRightCornerCell belong to different worksheets or a worksheet other than the worksheet to which this collection belongs.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, 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