Releases: GitHubMacrro/LiteExcel.Net
Releases · GitHubMacrro/LiteExcel.Net
Release list
LiteExcel v2.4.79
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
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=1to 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/RemoveTablebeing 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
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 tablecacheIdrestoration,_xlcn.*names preserved as-is). - Invalid
lengthIsOOXML type: Text-length conditional formatting now uses validcellIs+LEN()expressions (files containing this rule were previously rejected by Excel). FormulaEncodermulti-character operator loss: Fixed encoding loss for>=/<=/<>; addedSEARCH/LEFT/RIGHTtoFormulaFtab(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. IconSetInfoaddsReverse; 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
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
- CHANGELOG, USAGE.zh-CN/en, AGENTS updated.
- https://github.com/GitHubMacrro/LiteExcel.Net/blob/main/docs/CHANGELOG.md#2476---2026-09-11
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
LiteExcel v2.4.74
Full Changelog: v2.4.71...v2.4.74
LiteExcel v2.4.73
Full Changelog: v2.4.71...v2.4.73
LiteExcel v2.4.71
Full Changelog: v2.4.7...v2.4.71
LiteExcel v2.4.7
LiteExcel v2.4.6
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/ProtectStructureare True after opening.
2. Super Table (Table / ListObject)
ws.AddTable(ref, name, style?)/ws.RemoveTable(name)/ws.Tablesread-back.- 60 built-in Excel banded styles as the
TableStyleStyleenum (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.xmltableStyles. - 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 theIconSetStyleenum (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=falsewritestype="num".- Reads back set name, percent/showValue flags, and thresholds; a missing
iconSetattribute 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