Share via


WorksheetBase.Shapes Property

Gets a Microsoft.Office.Interop.Excel.Shapes object that represents all the shapes on the worksheet.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Syntax

'Declaration
Public ReadOnly Property Shapes As Shapes
public Shapes Shapes { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.Shapes
A Microsoft.Office.Interop.Excel.Shapes object that represents all the shapes on the worksheet.

Examples

The following code example uses the Shapes property to add a doughnut shape to the current worksheet.

This example is for a document-level customization.

Private Sub AddDonutShape()
    Dim textBox As Excel.Shape = _
        Me.Shapes.AddShape(Office.MsoAutoShapeType.msoShapeDonut, _
        50, 50, 150, 150)
End Sub
private void AddDonutShape()
{
    Excel.Shape textBox = this.Shapes.AddShape(
        Office.MsoAutoShapeType.msoShapeDonut, 50, 50, 150, 150);
}

.NET Framework Security

See Also

Reference

WorksheetBase Class

Microsoft.Office.Tools.Excel Namespace