HotXLS Docs

Activate method

Makes the specified sheet the active sheet. Equivalent to clicking the sheet's tab.

Syntax

procedure Activate;

Example

This example creates a summary sheet, makes it the active sheet, and saves the workbook so Excel opens on that sheet.

var
  Summary: IXLSWorksheet;
begin
  Summary := Workbook.Worksheets.Add;
  Summary.Name := 'Summary';
  Summary.Range['A1', 'A1'].Value := 'Monthly summary';

  Summary.Activate;
  Workbook.SaveAs('C:\Reports\summary.xls');
end;

See also