The FormulaToken.value of an error-REFERENCE token — #REF! or #NAME?, a reference
whose target is gone — split into the error it resolves to and its optional sheet qualifier.
Remarks
Data!#REF! is what a row delete leaves behind, and the qualifier is the only remaining record
of WHICH sheet's cells died — so it is carried beside the error rather than smeared into the
text, exactly as NamedRef carries a name's. OOXML models the same distinction natively
(PtgRefErr vs PtgRefErr3d).
Only error tokens that are REFERENCES take this shape. An error LITERAL (#DIV/0!, #N/A) is a
value, never scoped, and its value is the label alone. Both arrive as type: 'error', so a
consumer that wants the label either way reads value.error ?? value, and
FormulaError.getBuiltInByLabel turns it into the error.
Reference-layer only: EVALUATION of a #REF! still produces the plain FormulaError, so
a cell value never holds one of these.
The canonical label of the error the dead reference resolves to — #REF! (deleted cells) or
#NAME? (a stored unresolvable name).
OptionalReadonlyscope
scope?:string|null
The sheet name for a qualified error reference (Data!#REF!).
Remarks
Absent (or null) when the break was local to the formula's own sheet — the bare form Excel
writes for a same-sheet delete, and the only form it writes when the SHEET itself is deleted.
Bare, so it still needs quoting when it contains spaces.
The FormulaToken.value of an error-REFERENCE token —
#REF!or#NAME?, a reference whose target is gone — split into the error it resolves to and its optional sheet qualifier.Remarks
Data!#REF!is what a row delete leaves behind, and the qualifier is the only remaining record of WHICH sheet's cells died — so it is carried beside the error rather than smeared into the text, exactly as NamedRef carries a name's. OOXML models the same distinction natively (PtgRefErrvsPtgRefErr3d).Only error tokens that are REFERENCES take this shape. An error LITERAL (
#DIV/0!,#N/A) is a value, never scoped, and itsvalueis the label alone. Both arrive astype: 'error', so a consumer that wants the label either way readsvalue.error ?? value, andFormulaError.getBuiltInByLabelturns it into the error.Reference-layer only: EVALUATION of a
#REF!still produces the plain FormulaError, so a cell value never holds one of these.