SharpCell

XlsxReader

public static class XlsxReader

Namespace SharpCell.Xlsx · package SharpCell.Xlsx

Reads .xlsx workbooks: sheets, values, formulas with the results Excel cached, defined names, tables, hidden rows, whether a sheet is filtered, the date system, number formats, cell styles, column widths, row heights, merged cells, frozen panes and gridlines, from .xlsx and macro-enabled .xlsm files. Charts, pivot tables and macros are not read (a save keeps them; macros never run).

Every formula is out of date after loading: Cell.Value shows the value cached in the file until Workbook.Recalculate calculates it. A formula SharpCell cannot parse (for example a link to another workbook) does not fail the load; once calculated it is #NAME? and listed in Workbook.Diagnostics.

The workbook keeps the file's bytes in memory, so XlsxWriter can write changes into the same file.

Methods

Load(Stream)

public static Workbook Load(Stream stream)

Reads a workbook from a stream, which is left open.

Parameters

Returns: The workbook, with the results Excel saved until it is recalculated.

Exceptions

Load(string)

public static Workbook Load(string path)

Reads a workbook from a file.

Parameters

Returns: The workbook, with the results Excel saved until it is recalculated.

Exceptions