NativeExcel2 for .Net Developer's Reference

IWorksheets.AddAfterMethod(Object)

Creates a new worksheet after an existing worksheet.

[Visual Basic]
FunctionAddAfter(_
ByValAfterAsObject_
)AsIWorksheet
[C#]
IWorksheetAddAfter(
objectAfter
);
[C++]
IWorksheet*AddAfter(
Object*After
);
[JScript]
functionAddAfter(
ObjectAfter
):IWorksheet;

Parameters

After
An object that specifies the worksheet after which the new worksheet is added. Can be either an IWorksheet interface, Number which indicates the worksheet index or String which indicates the worksheet name.

Return Value

IWorksheet interface.

Example

This example creates a new worksheet after sheet with name "Sheet3".

[C#]
book.Worksheets.AddAfter("Sheet3");
[VisualBasic]
book.Worksheets.AddAfter("Sheet3")
[C++]
book->Worksheets->AddAfter(S"Sheet3");
This example creates a new worksheet after first worksheet.
[C#]
book.Worksheets.AddAfter(1);
[VisualBasic]
book.Worksheets.AddAfter(1)
[C++]
book->Worksheets->AddAfter(1);

See Also

IWorksheets Interface | NativeExcel Namespace | IWorksheets.AddAfter Overload List