Repository navigation
This closes #2503, resolve the defined name referenced by the current workbook index - #2508
Open
ruziba3vich wants to merge 1 commit into
Open
ruziba3vich wants to merge 1 commit into
ruziba3vich wants to merge 1 commit into
Conversation
…urrent workbook index
ruziba3vich
force-pushed
the
calc-defined-name-self-ref
branch
from
November 23, 2026 15:33
e3fa32e to
9c6e0ea
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2508 +/- ##
=======================================
Coverage 99.72% 99.72%
=======================================
Files 32 32
Lines 33202 33236 +34
=======================================
+ Hits 33112 33146 +34
Misses 88 88
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Details
Description
CalcCellValuereturned#NAME?when resolving a defined name prefixed with[0]!, which Excel uses to reference names in the current workbook. This change updatesgetDefinedNameRefToinlib.goto strip the[0]!prefix and resolve the name in workbook scope, with regression tests covering the behavior.Related Issue
Closes #2503
Motivation and Context
Excel itself writes and reads defined names using the
[0]!Namenotation, but Excelize currently fails to resolve them and returns#NAME?. Apache POI also treats this notation as a reference to a name in the current workbook, which supports the expected behavior implemented here.How Has This Been Tested
Added regression cases to
TestCalcWithDefinedNamecovering workbook-scoped name resolution, function arguments, and unknown names, verifying that they fail without the fix and pass with it. Rango test .locally on macOS; all tests passed.Types of changes
Checklist