Table of Contents

Class XlsbWorkbook

Namespace
ExcelReader.Core.Reader.Xlsb
Assembly
ExcelReader.Core.dll

An open binary Excel (.xlsb / BIFF12) workbook. Its sheets are read independently, each streaming its cells without loading the whole file into memory.

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

Remarks

Uses the same ZIP/OPC container as .xlsx, but worksheet parts are binary BIFF12 records. The workbook, styles, and shared-string parts are read once at open time (they're small); worksheets are streamed on demand by the enumerator. 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 XlsbSheet FirstSheet { get; }

Property Value

XlsbSheet

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<XlsbSheet> Sheets { get; }

Property Value

ExcelSheetList<XlsbSheet>

Exceptions

ObjectDisposedException

The workbook was disposed.

Tables

Gets the workbook's tables, ordered by sheet and then by the order they were created in. Opens nothing.

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 XlsbSheet)

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

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

Parameters

name ReadOnlySpan<char>

The sheet name to look for.

sheet XlsbSheet

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, ignoring case. Opens nothing.

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

Parameters

name ReadOnlySpan<char>

The table name to look for.

table ExcelTable

The matching table, when one is found.

Returns

bool

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

Exceptions

ObjectDisposedException

The workbook was disposed.