Class XlsWorkbook
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
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
SheetCount
Gets the number of sheets in the workbook.
public int SheetCount { get; }
Property Value
Sheets
Gets the workbook's sheets, in workbook order. Reading the list opens nothing.
public ExcelSheetList<XlsSheet> Sheets { get; }
Property Value
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
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
nameReadOnlySpan<char>The sheet name to look for.
sheetXlsSheetThe matching sheet, when one is found.
Returns
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
nameReadOnlySpan<char>The table name to look for.
tableExcelTableAlways null.
Returns
Exceptions
- ObjectDisposedException
The workbook was disposed.