Skip to content

Releases: GitHubMacrro/LiteExcel.Net

LiteExcel v2.4.79

Choose a tag to compare

@JackZ695 JackZ695 released this 28 Sep 12:47

LiteExcel v2.4.79

零第三方依赖的 .NET Excel 读写库 · net48 + net8.0 · MIT
本版聚焦代码稳定化收口:修正对象模型行号模型、样式往返边界、XLSB 高级部件保护,以及 XLSB verbatim 伪降级。
Fixed

  • 对象模型稀疏行绝对行号对齐(C1)
    Worksheet 单元格网格与 SheetData 统一为绝对 Excel 行号语义(新增 SheetData.RowNumbers 记录每行原始 1-based 行号)。修复打开含前导空行 / 内部空行的工作表后单元格错位;RowHeights、Filter.HiddenRows 现按绝对行号精确映射,MergedRanges 同步对齐。
  • 打开文件不再覆盖文档属性 Modified(C2)
    Workbook.FromSheetData 不再触发 OnWorksheetAdded;打开已有文件后读回的 WorkbookProperties.Modified 保持文件原值。
  • sheet 级样式恢复边界明确(C3)
    DefaultStyle 改为按「数据区单元格样式一致」的启发式推断恢复(非严格往返保证);新增 HeaderStyle 低层 SheetData.Headers 路径往返,对象模型 Save→Open 不保证恢复(设计限制)。
  • XLSB 高级部件保护缺口(Complex XLSB)
    源含工作簿级高级部件(xl/connections.bin / xl/model/item.data 等)且操作无法走 verbatim / surgical delete / surgical edit 保真路径时,现一律经 SaveDegradations 上报(宽松模式)或抛 LiteExcelException 阻止(严格模式),不再因「无法保真的修改落在非高级工作表」而静默回退整本重建、产出 Excel 无法打开的文件。
  • XLSB verbatim 伪降级(R-1)
    XlsbWriter 仅在重建 / 转换路径上报降级;无修改的 verbatim 保存不再误报 NamedRanges / DocumentProperties / Styles 降级(这些部件在 verbatim 路径逐字节保留)。
    Changed
  • Worksheet.FirstRowNumber:setter 标注 [Obsolete(error: false)];对象模型 Save 不使用该属性做行位移(对象模型按绝对行号写入;getter 仍反映打开文件的原始首行号)。
  • Worksheet.RowStyles:写出侧正确(按绝对行索引应用);对象模型 Open 不恢复 Worksheet.RowStyles(行级样式效果经 Cell.Style 保留)。
    Tests
  • 新增 C1–C3 / FirstRowNumber / RowStyles / Complex XLSB guard / R-1 回归测试。
  • 全量 770 测试通过(net8.0);net48 构建通过。
    Compatibility
  • 目标框架:net48;net8.0;零第三方运行时依赖;公开 API 兼容 Native AOT。
  • FirstRowNumber 的 setter 已标记 Obsolete(编译期警告,非破坏);如从第 N 行开始,请直接写入第 N 行。

LiteExcel v2.4.78

Choose a tag to compare

@GitHubMacrro GitHubMacrro released this 26 Sep 06:01

LiteExcel 2.4.78

Added

  • xlsb → xlsx/xlsm cross-format fidelity: opening an .xlsb and saving as .xlsx/.xlsm now preserves pivot tables, pivot caches, slicers, Power Query / Power Pivot connections, query tables, the data model, ActiveX shapes, cell styles, and conditional formatting instead of dropping them. Verified to open cleanly in Excel. Enabled by default; set LITEXCEL_DISABLE_PIVOT_WIRING=1 to fall back to drop-and-report.
  • XLSB surgical edit: for .xlsb files with advanced parts (pivot tables, connections, data model, macros), editing cell values, renaming a sheet, or appending a sheet preserves all other parts; Excel opens the result without repair.

Fixed

  • Cross-format save no longer silently drops advanced parts; reported via Workbook.SaveDegradations, blocked in strict mode.
  • Fixed corrupt XLSB output from surgical cell patches (offset drift when mixing replaced and inserted cells; duplicate row headers on new rows).
  • Fixed AddTable/RemoveTable being silently dropped on an opened .xlsb, and duplicate super-table parts on the rebuild path.
  • Fixed orphaned cache-reference records left after deleting an XLSB sheet.

Known limitation

  • On .xlsb files with Power Query / a data model, operations that trigger a full rebuild (deleting a sheet, inserting/deleting rows or columns, changing visibility/tab color, adding/removing super tables) may produce a file Excel refuses to open. Allowed by default and reported via SaveDegradations (blocked in strict mode). Editing cell values, renaming sheets, and appending plain sheets are unaffected.

Targets: net48 / net8.0; no third-party dependencies.

See the full changelog in CHANGELOG.

LiteExcel v2.4.77

Choose a tag to compare

@GitHubMacrro GitHubMacrro released this 18 Sep 03:17

LiteExcel 2.4.77

Added

  • XLSB conditional formatting write support (all types): Supports all 18 OOXML rule types (cellIs / expression / colorScale / dataBar / iconSet / top10 / aboveAverage / belowAverage / text / blank / error categories / uniqueValues / duplicateValues / timePeriod / textLength), including dxf styles (fill / font color / font weight / border), with global deduplication.
  • Worksheet visibility Worksheet.Visible: Visible / Hidden / VeryHidden; read/write for xlsx / xlsm / xlsb / xls.
  • Worksheet tab color Worksheet.TabColor: read/write for xlsx / xlsm.
  • XLSB capability gaps filled: named range readback, ListObject (Excel Tables) read/write, data validation read/write, floating image writing.

Fixed

  • XLSB surgical worksheet deletion fidelity: After deleting a worksheet from a workbook containing a Data Model (Power Pivot / Power Query) and saving, it no longer causes Excel to crash or show a repair prompt—fully replicating Excel's synchronized changes (part/relationship rId renumbering, XTI decrement, defined name invalidation, embedded rId renumbering for 0x046D/0x0430, pivot table cacheId restoration, _xlcn.* names preserved as-is).
  • Invalid lengthIs OOXML type: Text-length conditional formatting now uses valid cellIs + LEN() expressions (files containing this rule were previously rejected by Excel).
  • FormulaEncoder multi-character operator loss: Fixed encoding loss for >= / <= / <>; added SEARCH / LEFT / RIGHT to FormulaFtab (otherwise Excel refuses to open the file).

Changed

  • XLSB conditional formatting no longer reports degradation: All 18 rule types are now supported for writing; only unknown enum values are reported via DegradationCapability.ConditionalFormatting.
  • IconSetInfo adds Reverse; when thresholds are not explicitly provided, they are evenly distributed as integers (matching Excel, e.g. 0/33/67).

Tests

  • 710/710 (net8.0) passed; net48 build passed; AOT native smoke passed.

See the full changelog in CHANGELOG.

LiteExcel v2.4.76

Choose a tag to compare

@GitHubMacrro GitHubMacrro released this 15 Sep 04:44

LiteExcel 2.4.76

Highlights

  • XLSB surgical sheet deletion: deleting a worksheet and saving as xlsb now keeps
    pivot tables, pivot caches, tables, slicers, connections, query tables, the data
    model, ActiveX, charts and VBA as-is; workbook.bin BundleSh, defined-name itab,
    external-sheet XTI and activeTab/firstSheet are adjusted accordingly.
  • Fix: XLSB surgical delete no longer drops xl/vbaProject.bin (previously lost VBA
    while Content-Type/rels still declared it). Stale calcChain rel removed for
    consistency; verbatim write no longer duplicates vbaProject.

Behavior change

  • Workbook.AllowFeatureLossOnSave now defaults to true. Capabilities unsupported by
    the target format (VBA macros, BIFF8 pivot tables, XLSB advanced parts) are allowed
    on save and recorded in the new read-only Workbook.SaveDegradations list (never
    silent). Set AllowFeatureLossOnSave = false to restore strict mode (throws).
  • xlsm/xlsb -> xlsx/xls strips the VBA project and reports DegradationCapability.Macros.
    Note: formulas calling VBA UDFs will show #NAME? in Excel.

Fixes

  • XLS (BIFF8) size cap: clamp to 256 columns / 65536 rows to avoid out-of-range
    DIMENSIONS/COLINFO records; report DegradationCapability.SheetSize.
  • Wire SourceHasPivotTables when opening .xls (was never assigned).
  • BIFF8 date robustness: out-of-range serial values fall back to numbers.

Docs

Verification

  • 661/661 tests (net8.0), net48 build, AOT win-x64 publish + native smoke all pass.
  • Real-sample Excel COM matrix: 14/14 conversions open without repair; Test.xlsb
    delete keeps 9 sheets, 12 tables, 9 pivots and VBProject present.

LiteExcel v2.4.75

Choose a tag to compare

@JackZ695 JackZ695 released this 10 Sep 07:22

LiteExcel v2.4.74

Choose a tag to compare

@JackZ695 JackZ695 released this 09 Sep 15:16

Full Changelog: v2.4.71...v2.4.74

LiteExcel v2.4.73

Choose a tag to compare

@JackZ695 JackZ695 released this 09 Sep 15:15

Full Changelog: v2.4.71...v2.4.73

LiteExcel v2.4.71

Choose a tag to compare

@JackZ695 JackZ695 released this 03 Sep 00:47

Full Changelog: v2.4.7...v2.4.71

LiteExcel v2.4.7

Choose a tag to compare

@JackZ695 JackZ695 released this 04 Sep 04:39

Full Changelog: v2.4.7...v2.4.7

LiteExcel v2.4.6

Choose a tag to compare

@JackZ695 JackZ695 released this 25 Aug 05:50

Three capability batches — worksheet/workbook protection, super tables (Table/ListObject), and icon-set conditional formatting.

What's New

1. Sheet & Workbook Protection

  • Worksheet.Protection (sheetProtection): lock editing per flag (select locked/unlocked cells, sort, auto filter, insert/delete rows/columns, format cells, etc.), optional password.
  • Workbook.Protection (workbookProtection): lock structure / windows, optional password.
  • Passwords are written as SHA-512 + salt hashes (same mechanism as fileSharing); no plaintext in the file. SetPassword / VerifyPassword.
  • xlsx/xlsm only; xls/xlsb/csv report degradation via OnDegradation.
  • Verified with real Excel COM: ProtectContents / ProtectStructure are True after opening.

2. Super Table (Table / ListObject)

  • ws.AddTable(ref, name, style?) / ws.RemoveTable(name) / ws.Tables read-back.
  • 60 built-in Excel banded styles as the TableStyleStyle enum (Light/Medium/Dark) plus any style-name string (CustomStyleName, takes precedence).
  • Per-column formats via tbl.Column(name).NumberFormat / .Style → dataDxfId; optional header style → headerRowDxfId.
  • Writes xl/tables/table{N}.xml + <tableParts> + sheet rels + ContentTypes + styles.xml tableStyles.
  • Fidelity fix: opening an Excel-authored file with tables and re-saving no longer drops them (xl/tables/* + <tableParts> are preserved).
  • Unknown style names and xls/xlsb/csv writes report degradation.

3. Icon-Set Conditional Formatting

  • ConditionalFormatType.IconSet + IconSetInfo: 17 built-in sets as the IconSetStyle enum (arrows / traffic lights / symbols / ratings / quarters) plus any set-name string.
  • Percent / ShowValue / Thresholds; thresholds default to evenly divided by icon count (3→0/33/67, 4→0/25/50/75, 5→0/20/40/60/80); Percent=false writes type="num".
  • Reads back set name, percent/showValue flags, and thresholds; a missing iconSet attribute falls back to the default set (Excel-compatible).

Breaking changes

  • None. All existing APIs are preserved.

Notes

  • 541/541 unit tests pass on net48 + net8.0.
  • Verified with real Excel COM (no repair prompt) and the Native AOT gates (zero IL warnings; native executable assertions pass, including InvariantGlobalization=true).
  • Full changelog: docs/CHANGELOG.md