Move

Move(before, after)

Moves the current sheet to another location in the workbook.

Parameters:

Name Type Description
before ApiWorksheet

The sheet before which the current sheet will be placed. You cannot specify "before" if you specify "after".

after ApiWorksheet

The sheet after which the current sheet will be placed. You cannot specify "after" if you specify "before".

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("xlsx");
var oSheet1 = Api.GetActiveSheet();
Api.AddSheet("Sheet2");
var oSheet2 = Api.GetActiveSheet();
oSheet2.Move(oSheet1);
builder.SaveFile("xlsx", "Move.xlsx");
builder.CloseFile();

Resulting document