OfficeIMO

API Reference

Class

ExcelDocumentReader

Namespace OfficeIMO.Excel
Assembly OfficeIMO.Excel
Implements
IDisposable
Modifiers sealed

Reader for an Excel workbook (read-only). Provides access to sheet readers and basic metadata.

Inheritance

  • Object
  • ExcelDocumentReader

Methods

public virtual Void Dispose() #
Returns: Void

Disposes the underlying OpenXML document.

GetSheet 2 overloads
public ExcelSheetReader GetSheet(String name) #
Returns: ExcelSheetReader

Gets a reader for the specified worksheet name.

Parameters

name System.String requiredposition: 0
public ExcelSheetReader GetSheet(Int32 index) #
Returns: ExcelSheetReader

Gets a reader by sheet index (1-based, Excel display order).

Parameters

index System.Int32 requiredposition: 0
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: ExcelDocumentReader

Opens an Excel file for read-only access.

Parameters

path System.String requiredposition: 0
options OfficeIMO.Excel.ExcelReadOptions = null optionalposition: 1
public static ExcelDocumentReader Wrap(SpreadsheetDocument document, ExcelReadOptions options = null) #
Returns: ExcelDocumentReader

Wraps 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 requiredposition: 0
options OfficeIMO.Excel.ExcelReadOptions = null optionalposition: 1

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 requiredposition: 0
Workbook reader.
sheetName System.String requiredposition: 1
Sheet to extract.
a1Range System.String = null optionalposition: 2
A1 range; when null, uses the sheet's used range.
extract OfficeIMO.Excel.ExcelExtractionExtensions.ExcelExtractOptions = null optionalposition: 3
Extraction options.
chunking OfficeIMO.Excel.ExcelExtractChunkingOptions = null optionalposition: 4
Chunking options.
sourcePath System.String = null optionalposition: 5
Optional source path for citations.
cancellationToken System.Threading.CancellationToken = null optionalposition: 6
Cancellation token.