ReadonlyisFor runtime type checking.
ReadonlyoptionsReturns any custom workbook options that are provided in constructor.
Add Listeners.
Optionaloptions: IListener.OptionsAdds a new sheet to the workbook.
Optionaloptions: string | number | ISheetCollection.AddOptionsBatches all 'transactional' changes until they have all be committed or rolled back.
Optionaloptions: string | ITransaction.OperationOptions
Description of the operation or additional options. Used for tracking undo/redo and history. Default Value User Operation.
Any changes that are made to this object will be reflected in the local record but not committed to the transactional store until the batch is popped.
Useful for operations that are longer running but generally not recommended as it keeps a transaction open. doBatch is the preferred option.
Parses a formula expression and returns a transient formula object.
The formula expression to parse.
Optionalcoords: Partial<CellCoords>
Optional anchor coordinates.
Optionaloptions: CreateFormulaOptions
Optional parse options; the expression is storage text unless target is 'display'.
This is a convenience method for getCalculation().createFormula(expression, coords, options).
A bare reference (A2) resolves against the active cell's sheet; use
ISheet.createFormula to anchor against a specific sheet.
Provides a mechanism to perform a set of operations in a batch.
A callback that performs multiple operations all within the same transaction.
Optionaloptions: string | ITransaction.OperationOptions
Description of the operation or additional options. Used for tracking undo/redo and history. Default Value User Operation.
Evaluates a formula in the context of the sheet and returns the resulting value.
The formula to evaluate.
Optionaloptions: number | EvaluateOptions & Partial<CellCoords> & CreateFormulaOptions
Optional evaluation options.
Search the entire Workbook.
The text to search for or ICellRange.FindOptions
Given the name return a valid name that closely matches.
The string to validate.
Returns the ICalculation for the workbook.
The workbook's VBA code name — conventionally ThisWorkbook — or null if it has none.
The workbook-level counterpart to ISheet.getCodeName: the identifier VBA binds the
workbook's own document module through, where workbook event handlers such as Workbook_Open
live. Like a sheet's, it is carried from the file and read-only — see
ISheet.getCodeName for why SheetXL never mints one.
Returns the comments and notes on every sheet, in sheet order.
A view over each sheet's ISheet.getComments; getById and getByReplyId search
them all. A comment is added on a sheet's collection.
The workbook's external books — cached snapshots of other workbooks, addressed from a formula
as [n]Sheet1!$A$1. In [n] order.
A link is made by a formula — typing 'C:\path\[Budget.xlsx]Sheet1'!A1 adds a book here —
and removed by breaking it (IExternalBookCollection.breakLink). Each book lists the
formulas that cite it (IExternalBook.getDependents). The engine's collection, so
available once the calculation is constructed, which is before any sheet is.
A stable name for the workbook.
Returns the workbook's locale-profile overrides (the regional-override patch), or
null when the profile is entirely Intl-derived from IWorkbook.getLocale.
Returns the modules this workbook owns.
The workbook half of ISheet.getModules, and the same collection
getScripts().getModules() answers with — modules belong to the model, whereas
IScript is what runs them.
Holds the globally scoped modules, whose functions ARE in the formula namespace, and the workbook-scoped ones, whose functions are not (IModule.getScope). A sheet's modules are not in here at all; they hang off the sheet.
Like every module collection, this filters to TypeScript unless asked otherwise; imported VBA
is read with getItems({ language: 'vba' }).
Returns the display name for the workbook — a pure, read-only derivation of its
origin's name — or null for an unbound, unnamed workbook.
A workbook has no intrinsic name (like Excel: a workbook's name is its file name). Display fallbacks (a localized "Untitled") are a UI concern. Renaming is an origin-level operation (see IWorkbookIO.Origin.setName), never a model edit — it is not undoable.
Every INamed in the workbook — global names, every sheet's scoped names, and every table — sorted by type then by name.
The name-manager view: what EXISTS, not what any one sheet can see. A global name and a sheet-scoped name that share a name are two items here and both are returned; ask ISheet.getNames for the one a formula on that sheet would resolve to.
Returns the next sheet in the sheets collection. If the last one it will return the first.
Returns the workbook's origin — the file handle it lives in.
Always present: a new in-memory workbook holds an unbound origin (getPath() null). Like
the DOM's document.URL, which origin can change — a save that resolves a new destination (a
first save, a Save As) moves the workbook to the file it wrote, firing
onOriginChange. So read it when needed rather than
holding it; to follow the current file, listen for onOriginChange.
The model never mutates its origin, and the origin is not part of the persisted document (toJSON); a copy mints a fresh unbound origin.
Returns the people the workbook knows: the authors of its comments.
Returns the locale explicitly pinned on the workbook, or null when it
follows the environment locale.
IWorkbook.getLocale always resolves to a concrete tag; this is the only way to tell a pinned locale from an environment fallback that happens to match it. Only a pinned locale is persisted.
Returns the pivot tables on every sheet, in sheet order.
A view over each sheet's ISheet.getPivotTables; getByName searches them all.
Read-only for now: each table is carried as it was read and written back unchanged.
Returns the previous sheet in the sheets collection. If the first one it will return the last.
Returns the protection object for the workbook.
Returns ranges scoped to a sheet.
Optionaladdress: ICellRange.Address
Address of the ranges. Omit for the selected range — selection is modeled
by the SDK (not a UI mode), and many operations default to it. getSelectedRange remains
the explicit form.
Optionaloptions: ICellRange.GetRangeOptionsWhen accessing ranges from the IWorkbook ranges include a sheet name.
This enables cross-sheet references when working at the workbook level.
Some examples of cross-sheet reference are:
Linking data and formulas across multiple sheets.
Consolidating data from different sheets for analysis or reporting.
Performing calculations or comparisons that involve values from multiple sheets.
Returns an a set of ranges including sheet names.
Address of the ranges.
Optionaloptions: ICellRange.GetRangeOptionsReturns the current shared resources.
Returns any user defined functions stored with the workbook.
Returns the selected cell.
Returns a range of cells for the current selection.
Optionaloptions: ICellRange.GetRangeOptionsReturns ranges of cells for the current selection.
Optionaloptions: ICellRange.GetRangeOptionsReturns the currently active sheet within the workbook.
Returns the currently active sheet index within the workbook.
Returns the sheet for the given name, or the selected sheet when no name is given.
Optionalname: string
The name of the sheet. Omit for the selected sheet — "the sheet", unqualified,
is the one the user (or agent) is looking at. getSelectedSheet remains the explicit form.
Optionalvisibility: ISheet.Visibility
The visibility of the sheet.
Returns the sheet at the given offset.
A 0-based index of the sheet.
Optionalvisibility: ISheet.Visibility
The visibility of the sheet.
Returns the collection of sheets within the workbook.
Returns the statistics for the used cells across all sheets.
Optionaloptions: GetStatsOptions
Iterator options the stats are created with. At workbook scale prefer
{ onError: 'ignore' } — some error value existing somewhere is likely, and the
default 'throw' policy treats one as a fault when aggregating.
The workbook form of ISheet.getStats: every sheet's used range contributes,
including hidden and very-hidden sheets — visibility is a display concern, not a data
one. A workbook with no used cells returns empty statistics (getSize() === 0),
never null.
Cross-sheet value ordering (where observable) follows sheet index order.
Returns the current shared resources.
Returns the current IStyleCollection associated with this Workbook.
Get the current theme.
Returns the current shared resources.
When the cached values of getExternalBooks should be re-read from their sources on
open, or null where the source file said nothing (which Excel reads as userSet).
Carried, not obeyed — SheetXL never refreshes a link, so every mode behaves as never until
a resolver exists. Round-trips as workbookPr@updateLinks.
The mode is IExternalBookCollection.UpdateLinks: it governs the books as a set, and no single book has one. It is read and written HERE because it is a property of the workbook in both Excel's object model and the file, not of the collection the books live in.
Every committed update gives the record a new, strictly increasing version id.
Used with getId to uniquely identify a version of the record.
The id is an identity, not a per-record count: ids are drawn from a single store-wide sequence bumped once per commit, so all records written in the same commit share an id and a given record's ids increase but are not sequential.
Records are immutable so a restore/revert doesn't change them — it repoints, and the version id reported is the one for the snapshot the store is currently at. Version ids are never reused: a write after an undo receives an id higher than any previously issued, so a stale reader can always detect the change.
Returns the current view settings.
View settings determine how specific workbook level elements are displayed but does not affect the underlying data itself.
Indicates if the model has been closed.
Indicate if the current character is a valid character for a sheetName.
The string to validate.
Replace all items in the iterator
An iterator of cells to replace.
The ICell.Update or a callback to replace with.
Optionaloptions: ReplaceOptionsSet the regional locale of the workbook.
A BCP 47 tag, e.g. de-DE. Pass null to follow the
environment locale.
Patch individual derived regional settings on top of the locale — the escape
hatch for the OS-level customizations (a custom decimal symbol, a different
currency) that browser Intl cannot see.
A literal patch over the derived LocaleProfile (e.g.
{ decimal: '.', currencySymbol: 'CHF' }), or null to clear. Applied
literally — nothing is re-derived, so patch listSeparator too if you patch
decimal. Persisted in .sxl alongside the locale tag (never in .xlsx).
Sets getUpdateLinks. null writes no attribute at all.
Views have their own lifecycle because in a collaborative environment each user can have their own view.
Serialize the workbook to a JSON.
Optionaloptions: ToJSONOptions
Options to control the JSON output.
Returns when all calculations are complete and there are no pending calculations.
getCalculation().ready(), which starts the engine if
it has not been started.
An
IWorkbookrepresents a collection of sheets, along with shared resources.This interface provides methods for accessing its elements and event handling.
Remarks
Most interactions with a workbook or sheet are done through a workbook range.
See