Excel's Break Link: every cell formula that cites this book becomes its current values (the whole formula, not only the external operand), then the book is removed. One undoable step.
OptionaltxOptions: ITransaction.OperationOptionsA defined name that cites the book is left as it is and images as #REF! afterwards.
IExternalBookCollection.breakAll is this for every book. A book that is already gone
is left alone.
Removes this book, renumbering every later [n]. One undoable step.
OptionaltxOptions: ITransaction.OperationOptionsA formula still citing the book is NOT rewritten: it keeps the slot's id, images as #REF!
and computes #REF! — so an undo, which brings the slot and its id back, heals it. To turn
citations into values first, as Excel's Break Links does, use breakLink. A book that
is already gone is left alone.
The source book's own defined names, as seen at cache time — raw text, as the part spells it.
refersTo is what Excel cached: a leading = and quoted sheet names of the SOURCE
(='Data Sheet'!$B$2), #REF! for a name that held an expression rather than a reference, and
never a sheetId — Excel flattens a sheet-scoped source name into the book's namespace. Kept
verbatim; the engine compiles it inside the book ([1]!Name computes from the cache).
Every formula block that cites this book — directly, through a sheet of it, or as [n]!Name.
Derived from the compiled formulas, never stored: the same index a defined name's dependents
come from, so it is exact and current after any edit. A block on a sheet has that sheet's
stable id as its scope; a block whose scope is a defined name's id is that name's body,
which cites the book on behalf of everything that uses the name. A block citing the book
through two sheets is listed once.
Empty until the calculation engine has compiled the workbook's formulas.
How a scope into this book SPELLS, unquoted — Excel's source-closed form
(C:\dir\[Budget.xlsx]Sheet1) while the book is closed, its source-open form
([Budget.xlsx]Sheet1) once a resolver holds it.
OptionalsheetName: string | null
Omitted for the book-scoped [1]!Name form.
Which book this is, to us — stable for the life of the workbook and never persisted.
[n] is a POSITION, not a key: removing a book renumbers every citation after it. So a compiled
formula stores this id, and the [n] is projected from the collection's ordering
(the collection's ordering) whenever canonical text is produced. Same arrangement
NamedFormulaCollection uses for a named formula. Minted at
construction; a .sxl round trip mints new ones.
The cached cell values for one of the book's sheets, or null if that sheet was never cached.
Position in getSheetNames, matching the XML's sheetId (0-based).
Where the source workbook is — read from this book's own part relationships.
An ORDERED list, not one path with optional alternates: a book can carry several at once
(externalLinkPath, xlExternalLinkPath/xlPathMissing, externalLinkLongPath and the xxl21
alternateUrls extension are all instances of this one shape), and the entry the book is opened
from is sorted first. A LOCATION, never a key — two books can both be Budget.xlsx, which is
exactly why getId exists.
Deliberately NOT an IWorkbookIO.Origin: an origin is a live, listenable handle the IO
layer owns and can write back to, and this is a dead (relType, target) pair the source file
recorded. Turning one into the other is what a phase-E locator does.
Re-reads this book from its source and replaces the cache — Excel's Refresh on a row of the Workbook Links pane.
Needs a resolver (ICellContainerOptions.externalBookResolver, given when the workbook is
built); without one every book is 'unavailable' and nothing changes, which is the state a
workbook is in until a host supplies one (DESIGN-EXTERNAL-LINKS §4D). A replaced cache is one undoable step, and every formula
citing the book reads the new values. A resolver that throws leaves the cache as it was and
marks each cached sheet refreshError, as Excel records a refresh it could not complete.
Optionalto
A cached snapshot of another workbook, referenced from a formula as
[n]Sheet1!$A$1.Remarks
Excel's external link is not a live reference — it is the cache plus enough to go re-fetch the source. See the design doc for the full model:
private-assets/design/calc/DESIGN-EXTERNAL-LINKS.md.Two members read as "which book is this", and they answer different questions:
Budget.xlsxThey cannot collapse into one: a path cannot be the key, because two books may share one — hence a runtime id that is not one. getDisplayName is a projection of getSources, not a third identity.
A book has no position member. The
nin[n]is where the SOURCE FILE stores this book in its list, it renumbers when another book is removed, and no surface the reader sees spells one — so it belongs to IExternalBookCollection, which is what orders them, and not to the book.A book is immutable. Adding, removing and breaking one are the collection's operations (IExternalBookCollection); what a book itself answers beyond its snapshot is getDependents — which formulas cite it.