API Reference
Class
ExcelDocumentReader
Reader for an Excel workbook (read-only). Provides access to sheet readers and basic metadata.
Inheritance
- Object
- ExcelDocumentReader
Methods
GetSheet 2 overloads
public ExcelSheetReader GetSheet(String name) #Returns:
ExcelSheetReaderGets a reader for the specified worksheet name.
Parameters
- name System.String
public ExcelSheetReader GetSheet(Int32 index) #Returns:
ExcelSheetReaderGets a reader by sheet index (1-based, Excel display order).
Parameters
- index System.Int32
public IReadOnlyList<String> GetSheetNames() #Returns:
IReadOnlyList<String>Returns the list of sheet names in workbook order.
public static ExcelDocumentReader Open(String path, ExcelReadOptions options = null) #Returns:
ExcelDocumentReaderOpens an Excel file for read-only access.
Parameters
- path System.String
- options OfficeIMO.Excel.ExcelReadOptions = null
public static ExcelDocumentReader Wrap(SpreadsheetDocument document, ExcelReadOptions options = null) #Returns:
ExcelDocumentReaderWraps an already open SpreadsheetDocument without taking ownership. The returned reader must be disposed, but it will not close the underlying document.
Parameters
- document DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
- options OfficeIMO.Excel.ExcelReadOptions = null
Inherited Methods
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object
Properties
public Int32 SheetCount { get; } #The number of worksheets in the workbook.
Extension Methods
public static IEnumerable<ExcelExtractChunk> ExtractChunks(ExcelDocumentReader reader, String sheetName, String a1Range = null, ExcelExtractOptions extract = null, ExcelExtractChunkingOptions chunking = null, String sourcePath = null, CancellationToken cancellationToken = null) #Returns:
IEnumerable<ExcelExtractChunk>Extracts an Excel sheet range into row-chunked ExcelExtractChunk instances.
Parameters
- reader OfficeIMO.Excel.ExcelDocumentReader
- Workbook reader.
- sheetName System.String
- Sheet to extract.
- a1Range System.String = null
- A1 range; when null, uses the sheet's used range.
- extract OfficeIMO.Excel.ExcelExtractionExtensions.ExcelExtractOptions = null
- Extraction options.
- chunking OfficeIMO.Excel.ExcelExtractChunkingOptions = null
- Chunking options.
- sourcePath System.String = null
- Optional source path for citations.
- cancellationToken System.Threading.CancellationToken = null
- Cancellation token.