Version

Add(WorksheetShape) Method

Adds a shape to the collection.
Syntax
'Declaration
 
Public Overloads Sub Add( _
   ByVal shape As WorksheetShape _
) 
public void Add( 
   WorksheetShape shape
)

Parameters

shape
The shape to add to the collection.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionshape is null.
System.InvalidOperationExceptionshape has already been added to a worksheet or group.
System.InvalidOperationExceptionshape does not have the TopLeftCornerCell or BottomRightCornerCell set.
System.InvalidOperationExceptionAdding shape to this collection will place it on a different worksheet then either its TopLeftCornerCell or BottomRightCornerCell or shape is a WorksheetShapeGroup and adding it to this collection will create a similar situation for one of its descendant shapes.
System.InvalidOperationExceptionshape is a WorksheetShapeGroup and this is the group's collection of shapes.
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