[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IWorksheets.Add

Add Method

Add()

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

Declaration
IWorksheet Add()
Function Add() As IWorksheet
Returns
Type Description
IWorksheet

Returns the new worksheet.

Examples
IWorksheets worksheets = workbook.Worksheets;
IWorksheet newSheet = worksheets.Add();
int count = worksheets.Count;

Add(SheetType)

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

Declaration
IWorksheet Add(SheetType type)
Function Add(type As SheetType) As IWorksheet
Parameters
Type Name Description
SheetType type

The sheet's type.

Returns
Type Description
IWorksheet

Returns the new sheet.

Examples
IWorksheets worksheets = workbook.Worksheets;
IWorksheet chartSheet = worksheets.Add(SheetType.Chart);
SheetType sheetType = chartSheet.Type;