NativeExcel suite v1.x

Move method

Moves the sheet to another location in the workbook.

Syntax

procedure Move(Before: IXLSWorkSheet; After: IXLSWorkSheet; lcid: integer);
procedure Move(Before: IXLSWorkSheet; After: IXLSWorkSheet);
procedure Move(Before: IXLSWorkSheet);
BeforeIXLSWorkSheet. The sheet before which the moved sheet will be placed. You cannot specify Before if you specify After.
AfterIXLSWorkSheet. The sheet after which the moved sheet will be placed. You cannot specify After if you specify Before.
lcidInteger. The locale ID.

Example

This example moves the first sheet after the third sheet in the workbook.
Workbook.Sheets[1].Move(nil, Workbook.Sheets[3]);
This example moves the second sheet before the first sheet in the workbook.
Workbook.Sheets[2].Move(Workbook.Sheets[1]);
Copyright © NikaSoft 2004-2010