NativeExcel suite v1.x

AddBefore method

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

Syntax

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

Example

This example creates new worksheet before the sheet with name 'Sheet1'.
Var WorkSheet: IXLSWorksheet;
begin
  WorkSheet := WorkBook.Sheets.AddBefore('Sheet1');
  WorkSheet.Name := 'Before Sheet1';
end;
This example creates new worksheet before second worksheet.
WorkBook.Sheets.AddBefore(2);
Copyright © NikaSoft 2004-2010