Skip to content

LiteExcel v2.4.0

Choose a tag to compare

@GitHubMacrro GitHubMacrro released this 20 Aug 00:12
· 83 commits to main since this release

File-level security (open password / modify password) + rich report export (hyperlinks / freeze panes / images).

🆕 Added

File-Level Security (full round-trip for xlsx / xlsm / xlsb)

  • Open-password reading: Supports Agile Encryption (AES-256-CBC / SHA-512 / spinCount=100000) workbooks. Excel.Open(path, new ExcelReadOptions { OpenPassword = "..." })
  • Open-password saving: Passwords are inherited by default on SaveAs; explicitly set via wb.Security.SetOpenPassword("...")
  • Modify-password detection: Recognizes <fileSharing> write protection; Workbook.Security.HasModifyPassword reports the state; providing ModifyPassword grants edit/save permission
  • Modify-password save / remove: SetModifyPassword / RemoveModifyPassword / ClearAll
  • Security state: Workbook.Security → HasOpenPassword / HasModifyPassword / HasModifyAccess / IsReadOnly / CanSave / ReadOnlyRecommended
  • Passwords never appear in exceptions / logs / test output

Hyperlinks (xlsx / xlsm / xlsb / xls)

  • Cell.Hyperlink (Target / Tooltip / IsInternal)
  • External URL / file / mailto / UNC links and intra-workbook jumps supported

Freeze Panes (xlsx / xlsm / xlsb / xls)

  • Worksheet.FreezeRows / FreezeColumns — freeze any number of rows/columns
  • FreezeHeader retained as a convenience alias for FreezeRows=1

Image Write-Back (xlsx / xlsm)

  • Floating images: ws.AddImage(data, row, col, widthPx, heightPx, ImagePlacement.Floating)
  • InCell images: ws.AddImage(data, row, col, ImagePlacement.InCell) (richData pipeline)
  • Automatic extension (PNG/JPEG/GIF/BMP) and pixel-size detection; multi-sheet / multi-image / mixed modes
  • Adding an image to a workbook that already contains images merges into the existing drawing — no zip name collisions

🛠 Fixed

  • xlsb modify-password read/write round-trip (BrtFileSharingIso)
  • Read-only bypass: setting/modifying passwords without modify permission now throws
  • Internal-hyperlink OOXML correction (location instead of external rel; fixes mailto/file/UNC misclassification)
  • Decryption correctness: verifier hash truncated by hashSize, decrypted payload truncated by dataSize, dataIntegrity HMAC validation
  • Passing OpenPassword for a non-encrypted file now throws a clear exception
  • AddImage on an existing image workbook → media numbering preserved + drawing merged
  • Cell.CopyFrom deep-copies hyperlinks

📝 Changed

  • Worksheet.FreezeHeader semantics: now an alias for FreezeRows = 1 (still backfilled when ySplit=1 on read — backwards compatible)

⚠️ Compatibility Notes

  • No breaking changes (all additions are incremental properties/overloads)
  • Images are write-only (opening a file does not populate Images); image reading is out of scope for 2.4.0
  • xls/xlsb images and legacy xls passwords (RC4 XOR) are not in this release's scope
  • Full test suite: 423 tests passing, clean builds on net48 + net8.0