NativeExcel for .Net Developer's Reference

INames.Count Property

Returns the number of defined names in the collection.

[Visual Basic]

Property Value

System.Int32. The number of names in the INames collection.


This example deletes all the defined names from the worksheet one.

INames names = Workbook.Worksheets[1].Names;
int cnt = names.Count;
if (cnt > 0) {
   for (int i = cnt; i > 0; i--) names[i].Delete();
Dim names As INames = Workbook.Worksheets(1).Names
Dim cnt As Integer = names.Count
Dim i As Integer 
If cnt > 0 Then
   For i = cnt To 1 Step -1
   Next i   
End If
INames* names = Workbook->Worksheets->Item[1]->Names;
int cnt = names->Count;
if (cnt > 0) {
   for (int i = cnt; i > 0; i--) names->Item[i]->Delete();

See Also

INames Interface | NativeExcel Namespace | IWorksheet.Names property | IWorkbook.Names property | IName interface