[]
Represents a collection of all the sheets in the workbook.
public interface IWorksheets : IEnumerable<IWorksheet>, IEnumerable
Returns the number of objects in the collection (read-only).
int Count { get; }
Gets the worksheet using the index.
IWorksheet this[int index] { get; }
index
intThe index.
Gets the worksheet using the name.
IWorksheet this[string name] { get; }
name
stringThe worksheet's name.
Gets worksheets by names.
IWorksheets this[string[] name] { get; }
name
string[]An array that represents names of worksheets.
Creates a new worksheet. The new worksheet becomes the active sheet.
IWorksheet Add()
Returns the new worksheet.
Creates a new sheet. The new sheet becomes the active sheet.
IWorksheet Add(SheetType type)
type
SheetTypeThe sheet's type.
Returns the new sheet.
Creates a new worksheet and inserts it after the specified sheet.
IWorksheet AddAfter(IWorksheet sheet)
sheet
IWorksheetThe insert sheet.
Returns the new worksheet.
Creates a new worksheet and inserts it before the specified sheet.
IWorksheet AddBefore(IWorksheet sheet)
sheet
IWorksheetThe specified sheet index.
Returns the new worksheet.
Returns true if the specified Worksheet is contained by the collection of worksheets; otherwise, false is returned.
bool Contains(IWorksheet worksheet)
worksheet
IWorksheetThe IWorksheet object.
Returns whether the specified worksheet is contained by the collection of worksheets.
Copies the sheet collection to the end of the specified workbook.
IWorksheets Copy(IWorkbook targetWorkbook = null)
targetWorkbook
IWorkbookSpecifies the workbook to which the sheet collection will be copied. If missing, the sheet will be copied to the current workbook.
The new copied sheet collection.
Copies the sheet collection to the location after the specified sheet.
IWorksheets CopyAfter(IWorksheet targetSheet)
targetSheet
IWorksheetThe sheet after which the copied sheet collection will be placed. It can be the sheet of the same or another workbook.
The new copied sheet collection.
Copies the sheet collection to the location before the specified sheet.
IWorksheets CopyBefore(IWorksheet targetSheet)
targetSheet
IWorksheetThe sheet before which the copied sheet collection will be placed. It can be the sheet of the same or another workbook.
The new copied sheet collection.
Returns the zero-based index of the specified worksheet in the collection.
int IndexOf(IWorksheet worksheet)
worksheet
IWorksheetThe IWorksheet object.
Returns the zero-based index of the specified worksheet in the collection.
Moves the sheet collection to the end of the specified workbook.
IWorksheets Move(IWorkbook targetWorkbook = null)
targetWorkbook
IWorkbookSpecifies the workbook to which the sheet collection will be moved. If missing, the sheet will be copied to the current workbook.
The moved sheet collection.
Moves the sheet collection to the location after the specified sheet.
IWorksheets MoveAfter(IWorksheet targetSheet)
targetSheet
IWorksheetThe sheet after which the moved sheet collection will be placed. It can be the sheet of the same or another workbook.
The moved sheet collection.
Moves the sheet collection to the location before the specified sheet.
IWorksheets MoveBefore(IWorksheet targetSheet)
targetSheet
IWorksheetThe sheet before which the moved sheet collection will be placed. It can be the sheet of the same or another workbook.
The moved sheet collection.
Selects the object.
void Select(bool replace = true)
replace
boolUsed 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.