NativeExcel suite v1.x

AddAfter method

Creates a new worksheet after specified worksheet. The new worksheet becomes the active sheet.

Syntax

function AddAfter(Index: integer): IXLSWorkSheet;
function AddAfter(Name: WideString): IXLSWorkSheet;
function AddAfter(WorkSheet: IXLSWorkSheet): IXLSWorkSheet;
IndexInteger. An index of worksheet that specifies the sheet after which the new sheet is added.
NameWideString. A name of worksheet that specifies the sheet after which the new sheet is added.
WorkSheetIXLSWorkSheet. An object that specifies the sheet after which the new sheet is added.

Example

This example creates new worksheet after the sheet with name 'Sheet1'.
Var WorkSheet: IXLSWorksheet;
begin
  WorkSheet := WorkBook.Sheets.AddAfter('Sheet1');
  WorkSheet.Name := 'After Sheet1';
end;
This example creates new worksheet after first worksheet.
WorkBook.Sheets.AddAfter(1);
Copyright © NikaSoft 2004-2012