NativeExcel for .Net Developer's Reference

IShapes.Count Property

Returns the number of shapes in the collection.

[Visual Basic]
PropertyReadOnlyCountAsInteger
[C#]
intCount{get;}
[C++]
__propertyintget_Count();
[JScript]
functiongetCount():int

Property Value

Integer. The number of shapes in the IShapes collection.

Example

This example uses the Count property to set the value of A1 cell on the first sheet.

[C#]
IWorksheet sheet = book.Worksheets[1]; 
sheet.Range["A1"].Value = sheet.Shapes.Count;
[VisualBasic]
Dim sheet As IWorksheet = book.Worksheets(1) 
sheet.Range("A1").Value = sheet.Shapes.Count
[C++]
IWorksheet* sheet = book->Worksheets->Item[1]; 
sheet->Range->Item[S"A1"]->Value = sheet->Shapes->Count;

See Also

IShapes Interface | NativeExcel Namespace