Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@hypesystem
Copy link

Summary

In some cases the autofilter column index refers to an index not defined in the model.
This adds a guard against the case, so the xlsx parser does not crash.

Test plan

Don't know, guidance appreciated. Tests pass locally.

Related to source code (for typings update)

N/A

…l data.

Fixes exceljs#1842

Some validation rules in Excel result in the sheet taking a very long time to load, because the validation loops over all numbers in the range without checking if anything might be in the targeted fields.

This fix looks at the model to find the highest actual row in use, and clamps the range to that row, before running the Range on it.
In some cases the autofilter column index refers to an index not defined in the model
protobi-pieter added a commit to protobi/exceljs that referenced this pull request Nov 7, 2025
Adopts 5 low-complexity bug fixes from upstream exceljs/exceljs to improve
robustness and fix data corruption issues.

Changes:

1. exceljs#2851 - Fix boolean XML attribute parsing (Issue #18)
   - lib/xlsx/xform/simple/boolean-xform.js
   - Correctly handles <strike val="0"/> and other boolean attributes
   - Respects val attribute instead of always returning true

2. exceljs#2956 - Fix excelToDate() for non-numeric values (Issue #19)
   - lib/utils/utils.js
   - Prevents "Invalid Date" errors when cell has date format but non-numeric value
   - Eliminates Excel warnings on file open

3. exceljs#2973 - Fix dynamicFilter parsing in tables (Issue #20)
   - lib/xlsx/xform/table/filter-column-xform.js
   - Prevents exception when loading files with dynamic table filters
   - Ignores unsupported dynamicFilter nodes gracefully

4. exceljs#2915 - Fix WorkbookReader sharedString resolution (Issue #21)
   - lib/stream/xlsx/workbook-reader.js
   - Fixes data corruption where sharedString indices shown instead of actual values
   - Corrects stream piping for proper sharedString resolution

5. exceljs#2978 - Fix undefined column autofilter assignment (Issue #22)
   - lib/xlsx/xform/table/table-xform.js
   - Prevents crashes when autofilter references non-existent columns
   - Adds guard clause for missing column indices

All changes are low-risk, single-file modifications that fix real user-reported bugs.

Upstream PRs:
- exceljs#2851
- exceljs#2956
- exceljs#2973
- exceljs#2915
- exceljs#2978

Tests: All existing tests pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Jason233Wang <Jason33Wang@users.noreply.github.com>
Co-Authored-By: davepuchyr <davepuchyr@users.noreply.github.com>
Co-Authored-By: Johnny Oshika <johnnyoshika@users.noreply.github.com>
Co-Authored-By: Anecha Kuekharem <AnechaS@users.noreply.github.com>
Co-Authored-By: Niels Abildgaard <hypesystem@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.