NativeExcel2 for .Net Developer's Reference

IWorksheets.AddMethod

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

Overload List

Creates a new worksheet. The new worksheet will be added after the last worksheet.

[Visual Basic] FunctionAdd()AsIWorksheet
[C#] IWorksheetAdd();
[C++] IWorksheet*Add();
[JScript] functionAdd():IWorksheet;

Creates a new worksheet. You can insert the new worksheet either before or after an existing worksheet.

[Visual Basic] FunctionAdd(ByValObject,ByValObject)AsIWorksheet
[C#] IWorksheetAdd(object,object);
[C++] IWorksheet*Add(Object*,Object*);
[JScript] functionAdd(Object,Object):IWorksheet;

Creates new worksheets. You can insert the new worksheets either before or after an existing worksheet.

[Visual Basic] FunctionAdd(ByValObject,ByValObject,ByValInteger)AsIWorksheet
[C#] IWorksheetAdd(object,object,int);
[C++] IWorksheet*Add(Object*,Object*,int);
[JScript] functionAdd(Object,Object,int):IWorksheet;

Example

This example creates a new worksheet after last worksheet.

[C#]
book.Worksheets.Add();
[VisualBasic]
book.Worksheets.Add()
[C++]
book->Worksheets->Add();
This example creates a new worksheet after sheet with name "Orders".
[C#]
book.Worksheets.Add(null, "Orders");
[VisualBasic]
book.Worksheets.Add(Nothing, "Orders")
[C++]
book->Worksheets->Add(null, S"Orders");
This example creates a new worksheet before worksheet with index 2.
[C#]
book.Worksheets.Add(2, null);
[VisualBasic]
book.Worksheets.Add(2, Nothing)
[C++]
book->Worksheets->Add(2, null);

See Also

IWorksheets Interface | NativeExcel Namespace