Class ExcelWorksheets
- Namespace
- OfficeOpenXml
- Assembly
- EPPlus.dll
The collection of worksheets for the workbook
public class ExcelWorksheets : XmlHelper, IEnumerable<ExcelWorksheet>, IEnumerable, IDisposable
- Inheritance
-
ExcelWorksheets
- Implements
- Inherited Members
Properties
Count
Returns the number of worksheets in the workbook
public int Count { get; }
Property Value
this[int]
Returns the worksheet at the specified position.
public ExcelWorksheet this[int PositionID] { get; }
Parameters
PositionIDintThe position of the worksheet. Collection is zero-based or one-base depending on the Package.Compatibility.IsWorksheets1Based propery. Default is Zero based
Property Value
- See Also
this[string]
Returns the worksheet matching the specified name
public ExcelWorksheet this[string Name] { get; }
Parameters
NamestringThe name of the worksheet
Property Value
Methods
Add(string)
Adds a new blank worksheet.
public ExcelWorksheet Add(string Name)
Parameters
NamestringThe name of the workbook
Returns
Add(string, ExcelWorksheet)
Adds a copy of a worksheet
public ExcelWorksheet Add(string Name, ExcelWorksheet Copy)
Parameters
NamestringThe name of the workbook
CopyExcelWorksheetThe worksheet to be copied
Returns
AddChart(string, eChartType)
Adds a chartsheet to the workbook.
public ExcelChartsheet AddChart(string Name, eChartType chartType)
Parameters
NamestringThe name of the worksheet
chartTypeeChartTypeThe type of chart
Returns
AddChart(string, eChartType, ExcelPivotTable)
Adds a chartsheet to the workbook.
public ExcelChartsheet AddChart(string Name, eChartType chartType, ExcelPivotTable pivotTableSource)
Parameters
NamestringThe name of the worksheet
chartTypeeChartTypeThe type of chart
pivotTableSourceExcelPivotTableThe pivottable source
Returns
AddStockChart(string, ExcelRangeBase, ExcelRangeBase, ExcelRangeBase, ExcelRangeBase, ExcelRangeBase, ExcelRangeBase)
Adds a stock chart sheet to the workbook.
public ExcelChartsheet AddStockChart(string Name, ExcelRangeBase CategorySerie, ExcelRangeBase HighSerie, ExcelRangeBase LowSerie, ExcelRangeBase CloseSerie, ExcelRangeBase OpenSerie = null, ExcelRangeBase VolumeSerie = null)
Parameters
NamestringThe name of the worksheet
CategorySerieExcelRangeBaseThe category serie. A serie containing dates or names
HighSerieExcelRangeBaseThe high price serie
LowSerieExcelRangeBaseThe low price serie
CloseSerieExcelRangeBaseThe close price serie containing
OpenSerieExcelRangeBaseThe opening price serie. Supplying this serie will create a StockOHLC or StockVOHLC chart
VolumeSerieExcelRangeBaseThe volume represented as a column chart. Supplying this serie will create a StockVHLC or StockVOHLC chart
Returns
Copy(string, string)
Copies the named worksheet and creates a new worksheet in the same workbook
public ExcelWorksheet Copy(string Name, string NewName)
Parameters
NamestringThe name of the existing worksheet
NewNamestringThe name of the new worksheet to create
Returns
- ExcelWorksheet
The new copy added to the end of the worksheets collection
Delete(ExcelWorksheet)
Delete a worksheet from the collection
public void Delete(ExcelWorksheet Worksheet)
Parameters
WorksheetExcelWorksheetThe worksheet to delete
Delete(int)
Deletes a worksheet from the collection
public void Delete(int Index)
Parameters
IndexintThe position of the worksheet in the workbook
Delete(string)
Deletes a worksheet from the collection
public void Delete(string name)
Parameters
namestringThe name of the worksheet in the workbook
Dispose()
Dispose the worksheets collection
public void Dispose()
GetEnumerator()
Foreach support
public IEnumerator<ExcelWorksheet> GetEnumerator()
Returns
- IEnumerator<ExcelWorksheet>
An enumerator
MoveAfter(int, int)
Moves the source worksheet to the position after the target worksheet
public void MoveAfter(int sourcePositionId, int targetPositionId)
Parameters
sourcePositionIdintThe id of the source worksheet
targetPositionIdintThe id of the target worksheet
MoveAfter(string, string)
Moves the source worksheet to the position after the target worksheet
public void MoveAfter(string sourceName, string targetName)
Parameters
sourceNamestringThe name of the source worksheet
targetNamestringThe name of the target worksheet
MoveBefore(int, int)
Moves the source worksheet to the position before the target worksheet
public void MoveBefore(int sourcePositionId, int targetPositionId)
Parameters
sourcePositionIdintThe id of the source worksheet
targetPositionIdintThe id of the target worksheet
MoveBefore(string, string)
Moves the source worksheet to the position before the target worksheet
public void MoveBefore(string sourceName, string targetName)
Parameters
sourceNamestringThe name of the source worksheet
targetNamestringThe name of the target worksheet
MoveToEnd(int)
Moves the source worksheet to the end of the worksheets collection
public void MoveToEnd(int sourcePositionId)
Parameters
sourcePositionIdintThe position of the source worksheet
MoveToEnd(string)
Moves the source worksheet to the end of the worksheets collection
public void MoveToEnd(string sourceName)
Parameters
sourceNamestringThe name of the source worksheet
MoveToStart(int)
Moves the source worksheet to the start of the worksheets collection
public void MoveToStart(int sourcePositionId)
Parameters
sourcePositionIdintThe position of the source worksheet
MoveToStart(string)
Moves the source worksheet to the start of the worksheets collection
public void MoveToStart(string sourceName)
Parameters
sourceNamestringThe name of the source worksheet