Table of Contents

Class WorksheetsCollection

Namespace
Spire.Xls.Collections
Assembly
Spire.XLS.dll
public class WorksheetsCollection : XlsWorksheetsCollection, IList<IWorksheet>, ICollection<IWorksheet>, IEnumerable<IWorksheet>, IExcelApplication, IWorksheets, IEnumerable, ICloneParent
Inheritance
WorksheetsCollection
Implements
Inherited Members

Properties

this[int]

Returns a single object from a collection. Read-only.

public Worksheet this[int Index] { get; }

Parameters

Index int

Property Value

Worksheet

this[string]

Returns a single object from a collection. Read-only.

public Worksheet this[string sheetName] { get; }

Parameters

sheetName string

Property Value

Worksheet

Methods

Add(string)

Adds a new worksheet.

public Worksheet Add(string name)

Parameters

name string

Returns

Worksheet

Added worksheet.

AddCopy(WorksheetsCollection)

Adding worksheets collection to workbook.

public void AddCopy(WorksheetsCollection sheets)

Parameters

sheets WorksheetsCollection

AddCopy(Worksheet)

Adds copy of worksheet.

public Worksheet AddCopy(Worksheet sheet)

Parameters

sheet Worksheet

Worksheet to copy.

Returns

Worksheet

Added worksheet.

AddCopy(int)

Adds copy of worksheet.

public Worksheet AddCopy(int sheetIndex)

Parameters

sheetIndex int

Sheet index.

Returns

Worksheet

Added worksheet.

Create()

Creates a new worksheet.

public Worksheet Create()

Returns

Worksheet

Create(string)

Create a new worksheet.

public Worksheet Create(string name)

Parameters

name string

Worksheet name

Returns

Worksheet

FindAllBool(bool)

Finds the cell with the input bool.

public CellRange[] FindAllBool(bool boolValue)

Parameters

boolValue bool

Bool value to search for

Returns

CellRange[]

Found ranges

FindAllDateTime(DateTime)

Finds the cell with the input datetime.

public CellRange[] FindAllDateTime(DateTime dateTimeValue)

Parameters

dateTimeValue DateTime

DateTime value to search for

Returns

CellRange[]

Found ranges

FindAllNumber(double, bool)

Finds the cell with the input double.

public CellRange[] FindAllNumber(double doubleValue, bool formulaValue)

Parameters

doubleValue double

Double value to search for

formulaValue bool

Indicates whether to find formula value

Returns

CellRange[]

Found ranges

FindAllString(string, bool, bool)

Finds the cell with the input string.

public CellRange[] FindAllString(string stringValue, bool formula, bool formulaValue)

Parameters

stringValue string

String value to search for

formula bool

Indicates whether include formula

formulaValue bool

Indicates whether include formula value

Returns

CellRange[]

Found ranges

FindAllTimeSpan(TimeSpan)

Finds the cell with input timespan

public CellRange[] FindAllTimeSpan(TimeSpan timeSpanValue)

Parameters

timeSpanValue TimeSpan

time span value to search for

Returns

CellRange[]

Found ranges

FindBool(bool)

Finds the cell with the input bool.

public CellRange FindBool(bool boolValue)

Parameters

boolValue bool

Bool value to search for

Returns

CellRange

Found range

FindDateTime(DateTime)

Finds the cell with the input datetime.

public CellRange FindDateTime(DateTime dateTimeValue)

Parameters

dateTimeValue DateTime

Datetime value to search for

Returns

CellRange

Found range

FindNumber(double, bool)

Finds the cell with the input double.

public CellRange FindNumber(double doubleValue, bool formulaValue)

Parameters

doubleValue double

Double value to search for

formulaValue bool

Indicates whether includes formula value to search for

Returns

CellRange

Found range

FindString(string, bool, bool)

Finds the cell with the input string.

public CellRange FindString(string stringValue, bool formula, bool formulaValue)

Parameters

stringValue string

String value to search for

formula bool

Indicates whether includes formula to search for

formulaValue bool

Indicates whether includes formula value to search for

Returns

CellRange

Found range

FindTimeSpan(TimeSpan)

Finds the cell with the input time span.

public CellRange FindTimeSpan(TimeSpan timeSpanValue)

Parameters

timeSpanValue TimeSpan

Time span value to search for.

Returns

CellRange

Found range.

Remove(Worksheet)

Remove worksheet from collection.

public void Remove(Worksheet sheet)

Parameters

sheet Worksheet

Worksheet object.