HotXLS Delphi Excel Read Write Library / Component Developers Guide loslab Inc.

AfterNewSheet event

Occurs after the new Worksheet is added into the Workbook.

Description

You can use this event to set any additional options for created Worksheet.

Syntax

TAfterNewSheet = procedure(Sender: TObject; Worksheet: IXLSWorksheet) of object;
Sender TObject. Specifies the TDataToXLS component that triggered the event.
Worksheet IXLSWorksheet which represents a new Worksheet

Example

This example sets the PageSetup options for created Worksheet

procedure TForm1.DataToXLS1AfterNewSheet(Sender: TObject;
  Worksheet: IXLSWorksheet);
begin
  Worksheet.PageSetup.CenterHeader := 'Monthly report';
end;
Copyright©2007-2019 loslab.com