[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IWorksheets

Interface IWorksheets

Namespace
GrapeCity.Documents.Excel
Assembly
GcDocs.Excel.dll

Represents a collection of all the sheets in the workbook.

public interface IWorksheets : IEnumerable<IWorksheet>, IEnumerable
Inherited Members
System.Collections.Generic.IEnumerable<GrapeCity.Documents.Excel.IWorksheet>.GetEnumerator()

Properties

Count

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

int Count { get; }

Property Value

int

this[int]

Gets the worksheet using the index.

IWorksheet this[int index] { get; }

Parameters

index int

The index.

Property Value

IWorksheet

this[string]

Gets the worksheet using the name.

IWorksheet this[string name] { get; }

Parameters

name string

The worksheet's name.

Property Value

IWorksheet

this[string[]]

Gets worksheets by names.

IWorksheets this[string[] name] { get; }

Parameters

name string[]

An array that represents names of worksheets.

Property Value

IWorksheets

Methods

Add()

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

IWorksheet Add()

Returns

IWorksheet

Returns the new worksheet

Add(SheetType)

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

IWorksheet Add(SheetType type)

Parameters

type SheetType

The sheet's type.

Returns

IWorksheet

Returns the new sheet

AddAfter(IWorksheet)

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

IWorksheet AddAfter(IWorksheet sheet)

Parameters

sheet IWorksheet

The insert sheet

Returns

IWorksheet

Returns the new worksheet

AddBefore(IWorksheet)

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

IWorksheet AddBefore(IWorksheet sheet)

Parameters

sheet IWorksheet

The specified sheet index.

Returns

IWorksheet

Returns the new worksheet

Contains(IWorksheet)

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

bool Contains(IWorksheet worksheet)

Parameters

worksheet IWorksheet

The IWorksheet object.

Returns

bool

Returns whether the specified worksheet is contained by the collection of worksheets.

Copy(IWorkbook)

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

IWorksheets Copy(IWorkbook targetWorkbook = null)

Parameters

targetWorkbook IWorkbook

Specifies the workbook to which the sheet collection will be copied. If missing, the sheet will be copied to the current workbook.

Returns

IWorksheets

The new copied sheet collection.

CopyAfter(IWorksheet)

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

IWorksheets CopyAfter(IWorksheet targetSheet)

Parameters

targetSheet IWorksheet

The sheet after which the copied sheet collection will be placed. It can be the sheet of the same or another workbook.

Returns

IWorksheets

The new copied sheet collection.

CopyBefore(IWorksheet)

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

IWorksheets CopyBefore(IWorksheet targetSheet)

Parameters

targetSheet IWorksheet

The sheet before which the copied sheet collection will be placed. It can be the sheet of the same or another workbook.

Returns

IWorksheets

The new copied sheet collection.

IndexOf(IWorksheet)

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

int IndexOf(IWorksheet worksheet)

Parameters

worksheet IWorksheet

The IWorksheet object.

Returns

int

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.

IWorksheets Move(IWorkbook targetWorkbook = null)

Parameters

targetWorkbook IWorkbook

Specifies the workbook to which the sheet collection will be moved. If missing, the sheet will be copied to the current workbook.

Returns

IWorksheets

The moved sheet collection.

MoveAfter(IWorksheet)

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

IWorksheets MoveAfter(IWorksheet targetSheet)

Parameters

targetSheet IWorksheet

The sheet after which the moved sheet collection will be placed. It can be the sheet of the same or another workbook.

Returns

IWorksheets

The moved sheet collection.

MoveBefore(IWorksheet)

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

IWorksheets MoveBefore(IWorksheet targetSheet)

Parameters

targetSheet IWorksheet

The sheet before which the moved sheet collection will be placed. It can be the sheet of the same or another workbook.

Returns

IWorksheets

The moved sheet collection.

Select(bool)

Selects the object.

void Select(bool replace = true)

Parameters

replace bool

Used only with Worksheets. True to replace the current selection with the specified object. False to extend the current selection to include any previously selected objects and the specified object.