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)

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.

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 void AddDonutShape()
{
    Excel.Shape textBox = this.Shapes.AddShape(
        Office.MsoAutoShapeType.msoShapeDonut, 50, 50, 150, 150);
}
Return to top
Show: