NativeExcel suite v1.x

OnCreateWorksheet 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

TOnCreateWorksheet = procedure(Sender: TObject; Worksheet: IXLSWorksheet) of object;
SenderTObject. Specifies the TDataset2Excel component that triggered the event.
WorksheetIXLSWorksheet which represents a new worksheet

Example

This example sets the PageSetup options for created worksheet
procedure TForm1.Dataset2Excel1ONCreateWorksheet(Sender: TObject;
  Worksheet: IXLSWorksheet);
begin
  Worksheet.PageSetup.CenterHeader := 'Monthly report';
end;
Copyright © NikaSoft 2004-2007