Returns or sets the 1-based index of the active worksheet in a classic XLS workbook. Read/write Integer
Syntax
property ActiveSheetIndex: Integer;
Remarks
Setting this property activates the worksheet at the specified 1-based index and updates the active tab saved in the BIFF WINDOW1 record. Invalid indexes are ignored. Use
FirstSheet separately to control which sheet tab appears at the left edge of the tab bar
Example
This example saves the workbook so the third worksheet opens as the active sheet
Workbook.ActiveSheetIndex := 3;
Workbook.SaveAs('C:\Reports\book.xls');
See also