API Reference
ExcelDocumentReader
Reader for an Excel workbook (read-only). Provides access to sheet readers and basic metadata.
Inheritance
- Object
- ExcelDocumentReader
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Method ExcelDocument.CreateReader
- Method ExcelDocumentReader.Open
- Method ExcelDocumentReader.Wrap
Accepted by parameters
- Extension method ExcelDocumentReader.ExtractChunks
- Method ExcelExtractionExtensions.ExtractChunks
Methods
public ExcelSheetReader GetSheet(String name) #ExcelSheetReaderGets a reader for the specified worksheet name.
Parameters
- name System.String
public ExcelSheetReader GetSheet(Int32 index) #ExcelSheetReaderGets a reader by sheet index (1-based, Excel display order).
Parameters
- index System.Int32
public IReadOnlyList<String> GetSheetNames() #IReadOnlyList<String>Returns the list of sheet names in workbook order.
public static ExcelDocumentReader Open(Stream stream, ExcelReadOptions options = null) #ExcelDocumentReaderOpens an Excel file for read-only access.
Parameters
- path System.String
- options OfficeIMO.Excel.ExcelReadOptions = null
Open(System.IO.Stream stream, OfficeIMO.Excel.ExcelReadOptions options) #Opens an Excel workbook from the provided stream for read-only access.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Excel.ExcelReadOptions
public static ExcelDocumentReader Wrap(SpreadsheetDocument document, ExcelReadOptions options = null) #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
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) #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.