Table of Contents

Class XlsWorkbook

Namespace
ExcelReader.Core.Reader.Xls
Assembly
ExcelReader.Core.dll

An open legacy BIFF8 (.xls) workbook. Its sheets are read independently, each through synchronous and asynchronous enumeration.

public sealed class XlsWorkbook : IExcelWorkbook, IDisposable, IAsyncDisposable
Inheritance
XlsWorkbook
Implements
Inherited Members

Remarks

See IExcelWorkbook for the threading and lifetime contract.

Properties

FirstSheet

Gets the workbook's first sheet: the same sheet as Sheets[0]. Opens nothing.

public XlsSheet FirstSheet { get; }

Property Value

XlsSheet

Exceptions

ObjectDisposedException

The workbook was disposed.

IsDate1904

Gets a value indicating whether the workbook's date system is 1904-based rather than the default 1900-based system.

public bool IsDate1904 { get; }

Property Value

bool

SheetCount

Gets the number of sheets in the workbook.

public int SheetCount { get; }

Property Value

int

Sheets

Gets the workbook's sheets, in workbook order. Reading the list opens nothing.

public ExcelSheetList<XlsSheet> Sheets { get; }

Property Value

ExcelSheetList<XlsSheet>

Exceptions

ObjectDisposedException

The workbook was disposed.

Tables

Gets the workbook's tables: always empty, since XLS workbooks report no tables.

public IReadOnlyList<ExcelTable> Tables { get; }

Property Value

IReadOnlyList<ExcelTable>

Exceptions

ObjectDisposedException

The workbook was disposed.

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous dispose operation.

TryGetSheet(ReadOnlySpan<char>, out XlsSheet)

Finds a sheet by name, ignoring case. Opens nothing.

public bool TryGetSheet(ReadOnlySpan<char> name, out XlsSheet sheet)

Parameters

name ReadOnlySpan<char>

The sheet name to look for.

sheet XlsSheet

The matching sheet, when one is found.

Returns

bool

true if a sheet with that name exists; otherwise false.

Exceptions

ObjectDisposedException

The workbook was disposed.

TryGetTable(ReadOnlySpan<char>, out ExcelTable)

Finds a table by name: always fails, since XLS workbooks report no tables.

public bool TryGetTable(ReadOnlySpan<char> name, out ExcelTable table)

Parameters

name ReadOnlySpan<char>

The table name to look for.

table ExcelTable

Always null.

Returns

bool

Always false.

Exceptions

ObjectDisposedException

The workbook was disposed.