• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class SheetCollection

Represents a collection of all sheet types in a workbook.

Inheritance
object
SheetCollection
Implements
IEnumerable<Sheet>
IEnumerable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: DRIT.Spreadsheet
Assembly: DRIT.Spreadsheet.dll
Syntax
public class SheetCollection : IEnumerable<Sheet>, IEnumerable
Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

Properties

Count

Reports the number of items currently held by SheetCollection.

Declaration
public int Count { get; }
Property Value
Type Description
int

The count returned by the operation.

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

this[int]

Provides indexed access to values in the SheetCollection.

Declaration
public Sheet this[int index] { get; }
Parameters
Type Name Description
int index
Property Value
Type Description
Sheet

The this returned by the operation.

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

Worksheets

Exposes the worksheets associated with SheetCollection.

Declaration
public IEnumerable<Worksheet> Worksheets { get; }
Property Value
Type Description
IEnumerable<Worksheet>

The worksheets returned by the operation.

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

Methods

AddChartsheet()

Adds the supplied chartsheet to the SheetCollection.

Declaration
public Chartsheet AddChartsheet()
Returns
Type Description
Chartsheet

The add chartsheet returned by the operation.

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

AddChartsheet(string)

Create a chart sheet and add it to the collection of sheets.

Declaration
public Chartsheet AddChartsheet(string name)
Parameters
Type Name Description
string name
Returns
Type Description
Chartsheet
Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

AddMacrosheet(string)

Adds the supplied macrosheet to the SheetCollection.

Declaration
public Macrosheet AddMacrosheet(string name)
Parameters
Type Name Description
string name

The name used by the operation.

Returns
Type Description
Macrosheet

The add macrosheet returned by the operation.

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

AddWorksheet()

Adds the supplied worksheet to the SheetCollection.

Declaration
public Worksheet AddWorksheet()
Returns
Type Description
Worksheet

The add worksheet returned by the operation.

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

AddWorksheet(string)

Adds the supplied worksheet to the SheetCollection.

Declaration
public Worksheet AddWorksheet(string name)
Parameters
Type Name Description
string name

The name used by the operation.

Returns
Type Description
Worksheet

The add worksheet returned by the operation.

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

Contains(Sheet)

Exposes the contains associated with SheetCollection.

Declaration
public bool Contains(Sheet sheet)
Parameters
Type Name Description
Sheet sheet

The sheet used by the operation.

Returns
Type Description
bool

The contains returned by the operation.

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

GetEnumerator()

Retrieves the requested enumerator from the SheetCollection.

Declaration
public IEnumerator<Sheet> GetEnumerator()
Returns
Type Description
IEnumerator<Sheet>

The get enumerator returned by the operation.

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

GetSheet(string)

Retrieves the requested sheet from the SheetCollection.

Declaration
public Sheet GetSheet(string name)
Parameters
Type Name Description
string name

The name used by the operation.

Returns
Type Description
Sheet

The get sheet returned by the operation.

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

GetWorksheet(string)

Returns the sheet with a given name.

Declaration
public Worksheet GetWorksheet(string name)
Parameters
Type Name Description
string name

The name of the sheet. This is case insensitive

Returns
Type Description
Worksheet

The sheet

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

InsertWorksheet(int)

Adds the supplied ert worksheet to the SheetCollection.

Declaration
public Worksheet InsertWorksheet(int index)
Parameters
Type Name Description
int index

The index used by the operation.

Returns
Type Description
Worksheet

The insert worksheet returned by the operation.

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

Remove(string)

Removes the selected item from the SheetCollection.

Declaration
public void Remove(string name)
Parameters
Type Name Description
string name

The name used by the operation.

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

RemoveAt(int)

Removes the selected at from the SheetCollection.

Declaration
public void RemoveAt(int index)
Parameters
Type Name Description
int index

The index used by the operation.

Remarks

SheetCollection is the base collection that contains all sheets in a workbook, including worksheets, chart sheets, dialog sheets, and macro sheets.

Implements

IEnumerable<T>
IEnumerable
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX