[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IWorksheets

IWorksheets Interface

Represents a collection of all worksheets in a workbook.

This interface provides access to the worksheets contained in a workbook and supports retrieving, adding, copying, moving, and selecting worksheets. You can obtain an IWorksheets instance from Worksheets.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface IWorksheets : IEnumerable<IWorksheet>, IEnumerable
Public Interface IWorksheets
    Inherits IEnumerable(Of IWorksheet), IEnumerable
Examples
IWorksheets worksheets = workbook.Worksheets;
IWorksheet sheet1 = worksheets[0];
IWorksheet sheet2 = worksheets.Add();

Properties

Name Description
Count

Returns the number of IWorksheet objects in the collection (read-only).

this[int]

Gets the worksheet using the index.

this[string]

Gets the worksheet using the name.

this[string[]]

Gets worksheets by names.

Methods

Name Description
Add()

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

Add(SheetType)

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

AddAfter(IWorksheet)

Creates a new worksheet and inserts it after the specified sheet.

AddBefore(IWorksheet)

Creates a new worksheet and inserts it before the specified sheet.

Contains(IWorksheet)

Returns true if the specified Worksheet is contained by the collection of worksheets; otherwise, false is returned.

Copy(IWorkbook)

Copies the sheet collection to the end of the specified workbook.

CopyAfter(IWorksheet)

Copies the sheet collection to the location after the specified sheet.

CopyBefore(IWorksheet)

Copies the sheet collection to the location before the specified sheet.

IndexOf(IWorksheet)

Returns the zero-based index of the specified worksheet in the collection.

Move(IWorkbook)

Moves the sheet collection to the end of the specified workbook.

MoveAfter(IWorksheet)

Moves the sheet collection to the location after the specified sheet.

MoveBefore(IWorksheet)

Moves the sheet collection to the location before the specified sheet.

Select(bool)

Selects the worksheets in this collection.