Skip to content

Fix PnP named range crashes #3430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 14, 2025
Merged

Fix PnP named range crashes #3430

merged 3 commits into from
May 14, 2025

Conversation

CarsonF
Copy link
Member

@CarsonF CarsonF commented May 14, 2025

If an excel file is saved while there are multiple open, it can add internal index workbook references in named ranges (probably all formulas?)
Like:

[1]SheetName!A1

This can be safely parsed to mean A1 on SheetName.
The index is an internal thing that I don't think is even presented to users in Excel, but it does leak through in our navigation tools.

Now we ignore those optional [N] prefixes.

We also just ignore any named ranges that correspond to nonexistent sheets now.
This will prevent an all out extract crash just from a named range that we do not care about.

CarsonF added 2 commits May 14, 2025 12:23
The latest version of the PnP has named ranges like
```
[1]SheetName!A1
```
These brackets typically refer to the file paths of external workbooks.
But when Excel has multiple workbooks open, it can assign a temporary index here as well.

These can be safely ignored.

This comment was marked as off-topic.

coderabbitai[bot]

This comment was marked as resolved.

The errors we throw are probably 80% going to be our problem, not users.
@CarsonF CarsonF merged commit 1d48287 into develop May 14, 2025
14 of 15 checks passed
@CarsonF CarsonF deleted the bugfix/pnp-unknown-sheet branch May 14, 2025 17:50
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