HotXLS Docs

Index property

Returns the index number of the Defined name within the Names collection. Read only Integer.

Syntax

property Index: Integer;

Example

This example writes every defined name and its collection index to a worksheet so the workbook can include a visible name map.

var
  I: Integer;
  NameItem: IXLSName;
begin
  Workbook.Names.Add('SalesTotal', '=Summary!$B$10');

  for I := 1 to Workbook.Names.Count do
  begin
    NameItem := Workbook.Names[I];
    Workbook.Sheets[1].Cells[I, 1].Value := NameItem.Index;
    Workbook.Sheets[1].Cells[I, 2].Value := NameItem.Name;
    Workbook.Sheets[1].Cells[I, 3].Value := NameItem.RefersTo;
  end;
end;

See also