Class ExcelWorksheets
The collection of worksheets for the workbook
Implements
Inherited Members
Namespace: Experior.Core.Data.OfficeOpenXml
Assembly: Experior.Core.dll
Syntax
public class ExcelWorksheets : XmlHelper, IEnumerable<ExcelWorksheet>, IEnumerable, IDisposable
Properties
Count
Returns the number of worksheets in the workbook
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Item[Int32]
Returns the worksheet at the specified position.
Declaration
public ExcelWorksheet this[int PositionID] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | PositionID | The position of the worksheet. 1-base |
Property Value
Type | Description |
---|---|
ExcelWorksheet |
Item[String]
Returns the worksheet matching the specified name
Declaration
public ExcelWorksheet this[string Name] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | The name of the worksheet |
Property Value
Type | Description |
---|---|
ExcelWorksheet |
Methods
Add(String)
Adds a new blank worksheet.
Declaration
public ExcelWorksheet Add(string Name)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | The name of the workbook |
Returns
Type | Description |
---|---|
ExcelWorksheet |
Add(String, ExcelWorksheet)
Adds a copy of a worksheet
Declaration
public ExcelWorksheet Add(string Name, ExcelWorksheet Copy)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | The name of the workbook |
ExcelWorksheet | Copy | The worksheet to be copied |
Returns
Type | Description |
---|---|
ExcelWorksheet |
Copy(String, String)
Copies the named worksheet and creates a new worksheet in the same workbook
Declaration
public ExcelWorksheet Copy(string Name, string NewName)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | The name of the existing worksheet |
System.String | NewName | The name of the new worksheet to create |
Returns
Type | Description |
---|---|
ExcelWorksheet | The new copy added to the end of the worksheets collection |
Delete(ExcelWorksheet)
Delete a worksheet from the collection
Declaration
public void Delete(ExcelWorksheet Worksheet)
Parameters
Type | Name | Description |
---|---|---|
ExcelWorksheet | Worksheet | The worksheet to delete |
Delete(Int32)
Deletes a worksheet from the collection
Declaration
public void Delete(int Index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | Index | The position of the worksheet in the workbook |
Delete(String)
Deletes a worksheet from the collection
Declaration
public void Delete(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the worksheet in the workbook |
GetEnumerator()
Foreach support
Declaration
public IEnumerator<ExcelWorksheet> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<ExcelWorksheet> | An enumerator |
MoveAfter(Int32, Int32)
Moves the source worksheet to the position after the target worksheet
Declaration
public void MoveAfter(int sourcePositionId, int targetPositionId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sourcePositionId | The id of the source worksheet |
System.Int32 | targetPositionId | The id of the target worksheet |
MoveAfter(String, String)
Moves the source worksheet to the position after the target worksheet
Declaration
public void MoveAfter(string sourceName, string targetName)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceName | The name of the source worksheet |
System.String | targetName | The name of the target worksheet |
MoveBefore(Int32, Int32)
Moves the source worksheet to the position before the target worksheet
Declaration
public void MoveBefore(int sourcePositionId, int targetPositionId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sourcePositionId | The id of the source worksheet |
System.Int32 | targetPositionId | The id of the target worksheet |
MoveBefore(String, String)
Moves the source worksheet to the position before the target worksheet
Declaration
public void MoveBefore(string sourceName, string targetName)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceName | The name of the source worksheet |
System.String | targetName | The name of the target worksheet |
MoveToEnd(Int32)
Declaration
public void MoveToEnd(int sourcePositionId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sourcePositionId |
MoveToEnd(String)
Declaration
public void MoveToEnd(string sourceName)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceName |
MoveToStart(Int32)
Declaration
public void MoveToStart(int sourcePositionId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sourcePositionId |
MoveToStart(String)
Declaration
public void MoveToStart(string sourceName)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceName |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
IDisposable.Dispose()
Declaration
void IDisposable.Dispose()