Upgrading
Version policy
Formulon is before 1.0. A minor release may change the API incompatibly, and a patch release does not.
Each minor release with breaking changes comes with an upgrade guide in the repository, docs/releases/upgrading-<major>.<minor>.md. A patch release has none. The release notes index lists every guide, and the CHANGELOG marks each breaking change as BREAKING.
Install an exact version, and read the guides between your version and the new one before you move.
Moving to 0.19
0.19 makes the C ABI, the two JavaScript packages and the Python package one interface, with the same names, the same records and the same error model. Almost every program written against 0.18 needs changes, and most of them are renames.
The upgrade guide covers every change with before and after code. This section lists what you have to act on: first the changes every surface shares, then each surface's own. The rules behind the new shapes are on API conventions.
- Pin the new version and install it. A C caller also recompiles.
- In TypeScript, run the compiler. Most renamed keys and types are compile errors.
- In JavaScript without types and in Python, search your code for the former names in the guide's name migration tables. Some changes fail only at run time. An unknown key throws
TypeError, and so does a keyword argument passed under its old name. - Run your tests.
The guide also lists the changes binding by binding.
Names
One naming convention covers every public function, type and field in C, JavaScript and Python, and the former names are removed with no aliases.
Colsurvives only in coordinate names such asfirstCol.PivotAxis.ColisPivotAxis.Column, and likewisePivotCellKind.ColumnLabelandPivotShowValuesAs.PercentOfColumn.- A field with a unit carries it:
zoomScaleiszoomPct, a marginleftisleftIn, a fontsizeissizePt.
A rename that did not change the call's shape is not repeated here. Look it up in Name migration.
Sheet handles
A sheet-scoped call moves from the workbook onto a Sheet handle, and the sheet argument disappears:
- wb.setNumber(sheet, row, col, 42)
+ wb.sheet(sheet).setNumber(row, col, 42)- wb.set_number(sheet, row, col, 42.0)
+ wb[sheet].set_number(row, col, 42.0) # or wb.sheet(sheet)Calls that address the whole workbook (save, recalc, addFont, setDefinedName, setProfileId and the others without a sheet argument) stay on Workbook.
wb.sheet(key):
- It takes an index, a name or a
Sheet. - It returns the same object for the same sheet.
- The handle follows its sheet through add, copy, move and rename.
- It throws
StatusCode.NotFoundonce the sheet is removed.
Tables, pivots, pivot caches, charts, pictures, shapes and slicers are handles in the same way. The parent keeps add*, remove*, list* and the lookup (ws.table(name), ws.pivot(ref), ws.chart(id)). Every add* returns the handle, and a list* call returns handles, so map them through getProperties() before JSON.stringify.
A failed call throws FormulonError (Python: FormulonError or a subclass) instead of returning a status. Sheet handles in the guide has the full list.
Method shapes
Positional argument lists became records, and the verb says what the call does to them.
| Verb | Does |
|---|---|
set<X>(record) | Replaces a record |
set<X>(null) | Removes it |
update<X>(patch) | Changes only the keys the patch names |
reset<X> | Restores the default |
So setIterative(enabled, maxIterations, maxChange) is updateIterative(patch), clearPinnedNow() is setPinnedNow(null), removeAutoFilter() is setAutoFilter(null), and clearRowHeight is resetRowHeight.
An unknown key in a patch or an input record throws TypeError at any depth. null is accepted only for a key that can be cleared.
A hyperlink carries the range it covers. setHyperlink(link), whose HyperlinkInput.range is required, replaces addHyperlink and addHyperlinkRange.
- A link on exactly that range is replaced in place, and any other is appended.
removeHyperlink(range)removes every link that intersects the range.setHyperlink(cell, null)is gone.- Setting applies Excel's Hyperlink cell style to the range, and removing resets it to the default format.
Row and column spans are inclusive (first, last) pairs, inserts and deletes included:
- ws.insertRows(3, 2) // two rows at index 3
+ ws.insertRows(3, 4) // rows 3 to 4, inclusiveObjects that live under a key are addressed by it.
addCfRulereturns the rule'sCfRuleId.- Validations and sparkline groups have ids.
- A protected range is found by its name.
- A position still works where a list has one.
Drawings and tables:
- A drawing's placement is one nested
anchor, anddrawing.update({ name, description, hidden, anchor })replacesrenameandsetAnchoron every drawing kind. - A table column's totals and calculated-column formula go through
table.update({ columns })(Pythonupdate(columns=[TableColumnPatch(...)])), which replacessetColumnTotalsandTableColumnTotalsInput. Elementipatches columni.
Pivots:
- A pivot item bound to a cache index is
pivot.addFieldItem(field, { cacheIndex }, { visible: false }). - A pivot cache's worksheet source is
{ range, sheet, name }, ornullto remove it:
import createFormulon from '@libraz/formulon'
const formulon = await createFormulon()
const wb = formulon.Workbook.createDefault()
try {
const cache = wb.addPivotCache()
cache.setWorksheetSource({ range: 'A1:C10', sheet: 'Sheet1' })
console.log(JSON.stringify(cache.getWorksheetSource().range.rect)) // {"firstRow":0,"firstCol":0,"lastRow":9,"lastCol":2}
cache.setWorksheetSource(null) // clears the source
console.log(cache.getWorksheetSource()) // null
} finally {
wb.dispose()
}from formulon import PivotWorksheetSourceInput, Workbook
with Workbook.create_default() as wb:
cache = wb.add_pivot_cache()
cache.set_worksheet_source(PivotWorksheetSourceInput(range="A1:C10", sheet="Sheet1"))
print(cache.get_worksheet_source().range.rect) # CellRect(first_row=0, first_col=0, last_row=9, last_col=2)
cache.set_worksheet_source(None) # clears the source
print(cache.get_worksheet_source()) # NoneMethod shape changes in the guide maps each former call.
Enums
A member that stood for "absent" is gone, and the field reads null (Python None) instead. A chart without a legend has legend: null, not ChartLegendPosition.None, and ChartTitleKind.None and ChartAxisCrosses.Absent are gone the same way. Removing such a member renumbers the rest of its enum (ChartLegendPosition, ChartAxisCrosses), so a stored number has to be read back through the enum.
Several enums are renumbered so that the file format's default is 0, and one table now serves a concept that had one per feature.
AnchorKindandAnchorEditAsstart withDefault, andPivotSortOrderstarts withManual.ComparisonOperatoris shared by conditional formats, validation and AutoFilter.BlanksAsreplacesChartBlanksAsandSparklineEmptyCells.PivotDatePeriod, whose members are bit flags from seconds to years, replacesPivotDateGrouping.PivotFilterKindreplacesPivotFilterType.WorkbookFormathas noUnknown, soXlsxandXlsbare 0 and 1.ChartPlotType.ChartexisExtended.
Code that stores the numbers rather than the member names changes meaning, so compare against the members.
Strings that named a closed set (TableTotalsRowFunction, TableStyleElementType, ChartTickLabelPosition, ChartDomain, a custom icon's iconSet) are numbers now, and a string there throws TypeError. ChartInsertKind is removed:
- ws.addChart({ kind: ChartInsertKind.Column, source: 'A1:B5' })
+ ws.addChart({ type: ChartPlotType.Bar, barDirection: ChartBarDirection.Column, range: 'A1:B5' })Status code changes:
StatusCode.SheetIndexOutOfRangeandInvalidSheetNamemoved to 10 and 11, andIndexOutOfRange(13) is new.SheetCountLimitExceededis retired. A workbook past the sheet cap isSecurityResourceLimit.- The codes that no call returned are removed, and
ThreadedCommentInvalidis retired. - Status 5002, documented as
kIoFileTooLarge, is retired too. Every engine ceiling that is not an Excel limit, such as an over-budget input, an oversized archive entry or too many archive parts, isSecurityResourceLimit(6005; PythonSecurityError). Only the compression-ratio check staysIoZipBomb.
The new numbers are in Enums.
Result fields
An absent value reads null (Python None) on every read, where it used to be -1, an empty string or a value next to a has... flag. A test such as field.axis === -1 is now silently false:
- if (field.axis === -1) placeOnRows(field)
+ if (field.axis === null) placeOnRows(field)- A field that holds one rectangle is
rangeand a list of themranges.rectandrefare gone. - A single cell is a
CellAddressin a field such ascellortopLeft. - A defined name's
localSheetIdisscope. - A fill's
fg,bg,fgArgbandbgArgbareforegroundandbackground. - Every colour, a border side's included, is one
Colorrecord (kind,argb,theme,tint,indexed) in place ofColorSpec. - A chart or shape fill or line colour is a
DrawingColor: that record as itsbase, its DrawingMLtransforms, and the colour Excel renders asresolved(Charts).
The fields that changed are listed under Result fields.
A1 addresses and block access
Addresses:
- Every method with a cell argument takes
(row, col)or an A1 string. - Every method with a rectangle takes
'A1:B2'as well as aCellRect. A row or column span also takes'2:5'or'B:D'. - A sheet prefix, or a range where one cell is expected, is
InvalidArgument.
Block access:
Sheet.getandSheet.setare removed. In Pythonws["A1"]andws[row, col]read and write native values.getValues(range)andsetValues(a1, values)move a block in one call, and onelist*call replaces every count-and-index pair.- A read returns a native value (
getTypedValuegives the taggedValue). - A string that starts with
=written throughsetValueorws[...] =is a formula, so text from users goes throughsetText.
Details: A1 addresses and block access.
Changes on every surface
These apply to JavaScript, Python and C alike; the names are the JavaScript ones, and the Python and C names follow the naming rule.
Behaviour that changed without an error
Code that ran on 0.18 keeps running, with a different result.
Sheets, views and protection
- Sheet protection flags are
allow*and mean the opposite of the 0.18 fields they replace: 0.18'sformatCells: 1protected formatting, andallowFormatCells: falsedoes now. Negate every carried value. Theenabledfield is gone;setSheetProtection(null)removes the protection. Sheet.move(insertBefore)(Pythonmove, Cfm_workbook_move_sheet(wb, from_index, insert_before)) replacesmoveSheet(from, to), and its argument is the sheet to insert before, counted in the current order, ornullfor the end. 0.18'smoveSheet(0, 2)on three sheets put the first sheet last;move(2)puts it in the middle. See the example below.- A new workbook's first sheet is its selected tab (
getView().tabSelectedistrue); in 0.18 it wasfalse. activeSheet()of a workbook without<bookViews>is the first sheet, not the firsttabSelectedone, and a load applies Excel's open rule: a hidden active sheet is unhidden, a very hidden one passes activation to the first visible sheet, and an active sheet that is not selected becomes the only selected tab.
import createFormulon from '@libraz/formulon'
const formulon = await createFormulon()
using wb = formulon.Workbook.createDefault()
wb.addSheet('B')
wb.addSheet('C')
// 0.18: wb.moveSheet(0, 2) moved Sheet1 to the end.
wb.sheet('Sheet1').move(null)
console.log(wb.listSheets().map((s) => s.name).join(',')) // B,C,Sheet1
const ws = wb.sheet('B')
// 0.18: { formatCells: 0, ... } allowed formatting.
ws.setSheetProtection({ allowFormatCells: true })
console.log(ws.getSheetProtection().allowFormatCells) // truefrom formulon import SheetProtectionInput, Workbook
with Workbook.create_default() as wb:
wb.add_sheet("B")
wb.add_sheet("C")
# 0.18: wb.move_sheet(0, 2) moved Sheet1 to the end.
wb["Sheet1"].move(None)
print(",".join(s.name for s in wb.list_sheets())) # B,C,Sheet1
ws = wb["B"]
# 0.18: SheetProtection(format_cells=False, ...) allowed formatting.
ws.set_sheet_protection(SheetProtectionInput(allow_format_cells=True))
print(ws.get_sheet_protection().allow_format_cells) # TrueCells and formats
- An insert of rows, columns or cells that would push a value, formula, note, fill, border or merge off the sheet fails with
PreconditionFailedand changes nothing; 0.18 dropped what fell off. setBlankon a cell without a format of its own removes the cell, so it is no longer listed or counted andgetCellXfIndexreadsnullthere; 0.18 kept a blank cell.setRangeXfIndexover whole rows or columns writes row or column formats instead of a blank cell per address, sogetCellXfIndexisnullthere too, andsnapshotRangeXfswrites version 2 of its capture, which 0.18 cannot restore.- A save renumbers cell format indices the way Excel does: identical formats collapse into one and unused ones are dropped.
- A workbook saved and reopened can report different
getCellXfIndexvalues for the same cells. The formats they resolve to are unchanged (Cell formats in a saved file). - Differential formats are written only when something in the file references them, one record per user, so a reloaded file's
dxfIndexvalues can differ too. The live workbook keeps its indices.
- A workbook saved and reopened can report different
- Under a Mac profile, column geometry follows Mac Excel:
getWidthModel,convertColumnCharsToPt,getCellRectPt,CELL("width")and drawing anchors use the Mac width model and the profile's Normal font, where 0.18 used the Windows model on every profile. - A column with a style, an outline level or the hidden flag but no width of its own is now saved at the sheet's default width, without
customWidth, and a column whose only state is the default style is not written at all. 0.18 wrote such a column without a width, so Excel could open it hidden at zero width; saving the workbook again with 0.19 writes the width. - A font that states no family, charset or scheme is completed when a file is loaded and when
setDefaultFont,setFontoraddFontreceives it, sogetFontreports the completed values (a family-less游ゴシックreads charset 128, and family 3 under ajaprofile); 0.18 reported them absent until a save filled them in the written file. - A font linked to the theme (
schememinor or major) takes the theme's face for the profile's script (the Latin face under a profile other thanja,ko,zhorth) at load, when it is set, added or patched, when the theme changes and when the profile changes; 0.18 kept and saved the stored name.getFontright after a load reports the theme face, and a record set with a scheme and another name is stored under the theme face.- A Japanese book loaded without a
profileIdreads its theme-linked fonts under the defaulten_USprofile, so pass the profile the book was written for.
''is a literal value in the fields where Excel can store one:setCommentwith empty text writes a note with empty text (0.18 removed the note; passnullto remove it), a conditional-formattextof''is an empty operand that every non-error cell matches, and a slicercaptionof''takes the column name as an omitted one does.
Conditional formats, validation and sparklines
- A sparkline group without
displayEmptyCellsAsin the file reads as zero, as Excel reads it; 0.18 read it as a gap. - Inserting rows, columns or cells extends a conditional format or a validation over the inserted cells when it covered the cell just before them in the same column (in the same row for an insert to the right), as Excel does; 0.18 left the inserted cells out. Deletes add nothing, and sparklines, protected ranges, merges and tables do not grow.
- Opening a file merges its conditional-format rules the way Excel does, so
listCfRules()can return fewer rules than the file lists, and rewrites the ranges of each block as Excel opens them, so a rule'srangescan differ from the file's; evaluation results are the same. 0.18 kept every rule and range as stored. - Data validation
allowBlank,showInputMessageandshowErrorMessagedefault totrue, and a new table or pivot takes the workbook's table-style defaults. - A conditional-format block holding one data bar or colour scale rule swaps its first two range pieces on every load when the first is a single cell, as Excel does, so a block stored as
B2 B3reads asB3 B2. 0.18 kept the stored order. Blocks of several such rules, icon sets, pivot-scoped blocks and rules carrying extension content keep the stored order. - A protected range's security descriptor reads back in the spelling Excel saves (SID aliases upper-cased, the owner, group and DACL sections in that order, rights as tokens), not the text passed in, and a descriptor Excel drops reads back as
null(PythonNone). 0.18 returned the text as given.
Tables and pivots
- Writing text into a table's header cell renames the column, as Excel does; 0.18 left the column name unchanged.
- A structured reference reads back as Excel's formula bar shows it:
=Tbl[[#This Row],[a]]reads back as=Tbl[@a]. removeTableStylemoves every table and PivotTable that used the style to the default style of its kind; 0.18 left them naming the removed style.table.update({ totalsRow: true })grows the table by one row instead of overwriting the last data row, and turning the totals row on fills in Excel's defaults for a table that has never shown it.table.update({ headerRow: false })deletes the header cells and shrinks the range, where it used to flip the flag only; see Turn the header row off and on.- A pivot edit,
cache.refresh()orpivot.project()whose report would grow over occupied cells or past the sheet edge is applied and the report is blocked, its anchor showing#SPILL!, where it used to fail or overwrite. A field placed on a pivot axis lists its items at once, andaddFieldItemthrowsAlreadyExistsfor an item it lists (When a report is blocked). - A pivot cache marked
refreshOnLoadis refreshed from its source before the loaded workbook is first read, edited, calculated or saved, so its labels and values can differ from the file's records. Deleting the sheet a cache reads keeps the cache and its pivots, and a refresh then fails withPreconditionFailed; 0.18 removed them. - A data field added with the name
''keeps an empty caption, as Excel stores it; 0.18 named it from the source field. Omit the name (null,None,NULL) for the derived name.
Charts and pictures
- A cell holding an in-cell picture reads as a value of its own kind,
ValueKind.Picturewith apictureId(native reads return anExcelPicture; PythonValueKind.PICTURE, CFM_VALUE_KIND_PICTURE), and a formula that reads one carries it (=E2,TYPE128,COUNTAcounts it).- 0.18 read such a cell as
#VALUE!, so aswitchover everykindneeds the new case. Workbook.getCellPicture(pictureId)(Pythonget_cell_picture, Cfm_workbook_get_cell_picture) reads the image, andformatValuerefuses the kind withInvalidArgument(Picture values).
- 0.18 read such a cell as
- A chart line's system and long dash presets read as their own
ChartLineDashmembers,SysDot,SysDash,LgDash,LgDashDot,LgDashDotDot,SysDashDotandSysDashDotDot(5 to 11); 0.18 read them asOther. Code that treatsOtheras any non-basic dash should test for the new members too. - A chart or shape fill or line
colorreads as aDrawingColor, not the 0.18 ARGB number: read the colour Excel draws fromcolor.resolved.argband the stored colour fromcolor.basewithcolor.transforms. A Theme colour written with atintreads back as itslumMod/lumOfftransforms. getChart/get_chartnames a different call. The 0.18wb.getChart(sheet, objectId)(Pythonget_chart(...)) isws.chart(objectId).getProperties()(Python.get_properties());ws.getChart()(Pythonws.get_chart()) takes no argument and returns a chartsheet's chart handle, ornull(None) on any other sheet.
Formula text and entry
- Formula text read back carries a leading
=where Excel shows one (getFormulaR1C1, conditional-format and validation formulas, totals-row and calculated-item formulas,getLambdaText). Input accepts the text with or without it. - A cell formula loaded from an
.xlsxfile is respelled as Excel respells it on open: a cell stored assum(a1)reads back as=SUM(A1)and is saved that way, shared and array formulas included. Cached values are kept. Defined names, conditional-format, data-validation and table column formulas keep the stored text. Code that comparedgetFormulawith the file's raw text sees the respelled form. - An entered formula takes the same spelling: function names, references,
TRUE/FALSEand error literals are upper-cased and names take their stored spelling, sosetFormula('A1', '=sum(b1)')reads back=SUM(B1).- A sheet qualifier that names no sheet and no existing link binds an external link to a book of that name, as Excel does:
=Nope!A1adds a link, reads back=[Nope]Nope!A1and still evaluates to#REF!. - Code that counts external links or compares the entered text sees the difference (Formula entry).
- A sheet qualifier that names no sheet and no existing link binds an external link to a book of that name, as Excel does:
- A stored
.xlsxformula that spells a function newer than Excel 2007 without its_xlfn.prefix, asXLOOKUP(...)orlet(...), is read as a call to a user-defined function of that name, as Excel 365 reads it: it evaluates to#NAME?, shows as=@XLOOKUP(...)and saves as_xludf.XLOOKUP(...). 0.18 called the built-in function.- Cell formulas, defined names, conditional formats and validation formulas are read this way;
ANCHORARRAYstill reads as the built-in. - Code that writes
.xlsxfiles itself should store these functions with the_xlfn.prefix, and with_xlfn._xlws.or_xlpm.where Excel uses them, as Excel does.
- Cell formulas, defined names, conditional formats and validation formulas are read this way;
- A 3-D span entered last-to-first reads back in tab order:
=SUM(Sheet3:Sheet1!A1)reads=SUM(Sheet1:Sheet3!A1), where 0.18 kept the typed order. The value does not change. Code that comparesgetFormulaoutput with the text it entered must expect the reordered span.
Defined names
- A defined name bound to a cell or range is read as that reference in aggregating arguments, so text and logical cells behind it are skipped as for the reference written out: with
TextCellnaming a text cell,MAX(TextCell)is0andMIN(TextCell,3)is3. 0.18 treated the name as a direct argument, returning#VALUE!for text and countingTRUEas1. A name bound to a constant value is still a direct argument. - A defined name loaded from a file with a bare comma-list body, such as
Sheet1!$A$1,Sheet1!$B$1, is one reference over both areas. With4inA1and6inB1,=SUM(U)over such a nameUis10and=INDEX(U,1,1,2)is6; 0.18 kept the name's text but returned#NAME?and#REF!, andsetDefinedNamerefused such a body with status 1000; it now stores it as written. - A built-in name typed without its
_xlnm.prefix resolves to the built-in: with a print area ofA1:B3onSheet1,=ROWS(Print_Area)is3and is stored as_xlnm.Print_Area, where 0.18 returned#NAME?. The formula text now shows built-in names without the prefix, so a stored=ROWS(_xlnm.Print_Area)reads back as=ROWS(Print_Area); code that parsesgetFormulaoutput must accept the bare form.=AREAS(NoSuchName)is#NAME?, where 0.18 returned#VALUE!. - Formula text around defined names changed; values did not.
- A sheet-qualified name whose sheet does not define it, such as
=Sheet3!wbnfor a workbook-scopewbn, is stored as[0]!wbnand read back with the file name in place of[0]once the workbook has a location (setLocation), and as=[0]!wbnbefore that, where 0.18 kept=Sheet3!wbn. - An unresolved built-in name reads back in its canonical spelling, so
=ROWS(print_titles)reads=ROWS(Print_Titles). localizeFormulawrites built-in names in the locale's spelling:=ROWS(_xlnm.Print_Area)undermac-365-de_DEis=ZEILEN(Druckbereich), where 0.18 gave=ZEILEN(_xlnm.Print_Area).- Code that compares formula text must expect these forms.
- A sheet-qualified name whose sheet does not define it, such as
- A bare built-in name in a cell formula read from a file now reaches the built-in when the workbook is opened under a profile that spells the name in English, as en_US and ja_JP do: with a built-in
Criteriaof$A$1:$A$3onSheet1, a loaded=ROWS(Criteria)is3under ja_JP, where 0.18 returned#NAME?under every profile.- Under a profile that spells the name differently, such as de_DE, it stays
#NAME?unless a user-defined name has that spelling. canonicalizeFormulanow turns a local built-in spelling into the_xlnm.form:=ZEILEN(Druckbereich)inmac-365-de_DEbecomes=ROWS(_xlnm.Print_Area), where 0.18 returned=ROWS(Druckbereich).
- Under a profile that spells the name differently, such as de_DE, it stays
setDefinedNamewith the profile locale's spelling of a built-in name stores that built-in.- With
Print_Areaunder en_US or ja_JP, orDruckbereichunder de_DE, a formula namingSheet2, andSheet1active, the name is stored as_xlnm.Print_AreainSheet1's scope andgetPrintArea()onSheet1reads it. 0.18 stored the typed name at workbook scope and every sheet's print area read as empty. - A new
Print_AreaorPrint_Titlesat workbook scope becomes local to the active worksheet whatever sheet its formula names, and stays at workbook scope when a chartsheet is active. - With a dialog sheet or macro sheet active, or scoped to a sheet that is not a worksheet, it fails with
InvalidArgument. - Other built-in names are stored as the built-in in the requested scope.
getDefinedNameandremoveDefinedNamefind the stored entry by the typed spelling.- Code that reads a name back under the name it passed must allow for the new name and scope.
resolveDefinedNameKey(input)returns the key a set stores under.
- With
Workbook.load(bytes, { profileId })reads a defined name stored without_xlnm.but spelled as that profile locale's built-in as the built-in, and the formulas naming it follow, unless that built-in is already visible from the name's scope. A workbook-scopeDruckbereichloads as_xlnm.Print_Areaunder de_DE and=ROWS(Druckbereich)reads back=ROWS(Print_Area); under en_US, ja_JP and the default profile it stays an ordinary name. 0.18 kept it an ordinary name under every profile.
External links and saved values
- A loaded workbook keeps its saved values where Excel would: a file saved in Manual mode, and a file saved in Auto mode that carries the
calcIdthe current Excel stamps and nofullCalcOnLoad.- Only formulas the file marks for recalculation and formulas without a cached value start dirty.
- 0.18 marked every loaded formula in both modes, so the first read, save or
recalc()recomputed all of them. - A file from another Excel version, with no
calcId, or withfullCalcOnLoadis still recomputed in full.
- A reference to deleted cells in another workbook, such as
[Book.xlsx]Sheet1!#REF!, reads as the#REF!value the localSheet1!#REF!is:COUNTAcounts it andSUMreturns#REF!. 0.18 refused it at entry with a parse error, and a formula holding it in a loaded file evaluated to#NAME?. - A stored book-level external
[1]!#REF!reads differently. When the link's target is an absolute path such as/data/ExtSource.xlsx,[1]!#REF!,=COUNTA([1]!#REF!)and=ISERROR([1]!#REF!)are#REF!,1andTRUE, where 0.18 returned#NAME?in every such cell. For every link the formula text now names a sheet after the file, as Excel saves it:=COUNTA([ShortBook1.xlsx]ShortBook1!#REF!)where 0.18 read=COUNTA(ShortBook1.xlsx!#REF!), and=COUNTA('/data/[ExtSource.xlsx]ExtSource'!#REF!)where 0.18 read=COUNTA('/data/ExtSource.xlsx'!#REF!). - A save writes only the external links something in the workbook references, as Excel's save does, wherever an unreferenced link sits, and numbers the survivors again from 1: the link parts and every
[n]in formulas and defined names follow the new numbers. 0.18 wrote every loaded link.- A link only a defined name references is kept.
- Content written back as stored and OLE or DDE links keep every link up to the highest number they name, and a workbook with a binary macro or dialog sheet or a formula that does not parse keeps every link.
- The model keeps every link, so
listExternalLinks()is unchanged; only the written file differs, and code that reads[n]from the saved file must expect the new numbers.
- A loaded workbook numbers its external links by first use, as Excel does on open: defined names, then cell formulas from the active sheet, then the other sheets in tab order. 0.18 kept the file's stored order, so
[n]in formula text andbookNumbercan differ from the file. - After an
.xlsbsave and reload, a range or 3-D span over an external sheet that the file stores as a failed refresh with no rows reads#REF!, as a single-cell reference to it and an.xlsxround trip already did. 0.18 read such a range as an empty cache.
Function and lookup behaviour
LEN,MID,FIND,SEARCHandREPLACEcount a character outside the Basic Multilingual Plane, such as an emoji, by the workbook's Compatibility Version instead of the profile. New workbooks and files that carry version 2 count it as one position; files that carry no version or version 1 count it as two. Windows profiles, the defaultwin-365-en_USincluded, used to count it as two everywhere, and Mac profiles as one everywhere.- The
WORKDAYfamily (WORKDAY,WORKDAY.INTL,NETWORKDAYS,NETWORKDAYS.INTL) returns one result per element when the start, days or end argument is an array, as=WORKDAY(45292,{1,2})or=WORKDAY(45292,A1:A2*1); 0.18 returned a single#VALUE!for these. The.INTLweekend argument lifts over an array or a reference. A multi-cell reference in the start, days or end argument, as=WORKDAY(45292,A1:A2), still returns#VALUE!. TAKEandDROPwith an array or multi-cell reference as the row or column count return one result per count, each the top-left cell of the slice that count selects, as=TAKE({1,2;3,4},{1;2})returns{1;1}; an empty slice is#CALC!. 0.18 returned a single#VALUE!for these.- In a formula stored without the dynamic-array mark, an array constant, or an operator over one, in an argument that accepts an array is no longer reduced to its first element, so the formula returns what Excel returns, and
getFormulashows no@there. For example,SUM(COUNTIFS(A1:A5,{">","="}&0,B1:B5,{"<","<"}&5))counts every criteria pair; 0.18 counted only the first and showed@{">","="}&0. - The spill operator over a formula that does not spill, as
B1#with=1+1inB1, reads that formula's value as a one-cell region, andROWSandCOLUMNScount it as1; 0.18 returned#REF!for both. An anchor holding a constant still reads#REF!. - A lookup for
0no longer matches a blank key inVLOOKUP,HLOOKUPorXLOOKUP; in 0.18=VLOOKUP(0,A1:B3,2,FALSE)and=XLOOKUP(0,A1:A3,B1:B3)returned the row of a blankA1. A blank or omitted lookup value inVLOOKUP,HLOOKUP,MATCHandLOOKUPis the number0and finds a0key; in 0.18VLOOKUPwith a blank lookup value returned the blank key's row andMATCH(<blank>,A1:A3,0)returned#N/A.XLOOKUPandXMATCHstill find a blank key for a blank lookup value. - A
LAMBDAwith an optional parameter saved by Excel, stored as_xlop.b, now loads as[b]and evaluates. 0.18 showed the stored_xlop.bspelling and returned an error on recalculation,#VALUE!or#NAME?depending on the call. SHEETover a structured table reference, such asSHEET(Table1[])orSHEET(Table1[Feb]), returns the number of the sheet holding the table, as Excel does; 0.18 returned#VALUE!.SHEETSover a table reference was already1.LOOKUPwith an array lookup value, such as=LOOKUP({100;5},A1:A3,B1:B3), searches each element on its own and spills one result per element, asVLOOKUPalready did; 0.18 returned a single#N/A.- When several arguments of a function fail, the result is the error of the first argument the function checks, as in Excel:
=FLOOR("x",1/0)is#VALUE!for the text. 0.18 reported an error argument ahead of any text that fails to coerce, wherever it sat, so the same formula gave#DIV/0!. From the other side, with#N/AinA1,=SORT(A1,"x")now returns the data cell's#N/A, where 0.18 returned#VALUE!for the option;UNIQUEandEXPANDchanged the same way. GCD,LCM,MULTINOMIAL,IMSUM,IMPRODUCTandCONCATreturn#VALUE!for a parenthesised union such as(A1:A2,C1:C2). 0.18 read every area, so with4,6inA1:A2and8,10inC1:C2,=GCD((A1:A2,C1:C2))gave2and=CONCAT((A1:A2,C1:C2))gave"46810".SUM,COUNTandANDstill read every area, and they now read a union returned byLETthe same way: with4inA1and6inB1,=SUM(LET(u,(A1,B1),u))is10, where 0.18 returned#VALUE!.- A logical value in a matrix operand and an empty or missing
TEXTSPLITdelimiter, which 0.18 let through, now return#VALUE!. WithTRUEinA1, numbers inB1:B2andA2, and an identity matrix inG1:H2,=MMULT(A1:B2,G1:H2)is#VALUE!, where 0.18 readTRUEas 1 and spilled the input; the same holds forMINVERSE,MDETERM,LINEST,LOGEST,TRENDandGROWTHover a range holding a logical value.=TEXTSPLIT("a,b","")and=TEXTSPLIT("a,b",)are#VALUE!, where 0.18 returneda,bunsplit. CELL("contents")of a blank cell is a blank: withA1empty,=ISBLANK(CELL("contents",A1))isTRUE,=LEN(CELL("contents",A1))is0and=CELL("contents",A1)&""is"", where 0.18 returnedFALSE,1and"0". The formula alone still shows0.COUNTBLANKover a reference into a closed workbook counts the cells the link cache holds no value for: with onlyS!A1cached,=COUNTBLANK([1]S!A1:A5)is4, where 0.18 returned#VALUE!for a single external cell, a range and a whole column alike.COUNTIFand the other*IFfunctions there still return#VALUE!.- A structured table reference is a reference wherever a plain range is.
=@Table1[Qty]intersects the formula's row, as@over the range does: on a row beside the table it reads that row's value, and on a row outside the table it returns#VALUE!. 0.18 returned the column's first value on any row. The same holds for a table reference bound withLETor passed throughTAKE.OFFSETtakes a table reference as its base, andAREAS,CELLandISFORMULAread the reference's range:=AREAS(Table1[Qty])is1,=CELL("address",Table1[Qty])is the first cell's address, and=SUM(OFFSET(Table1[Qty],1,0))sums the shifted range; 0.18 returned#VALUE!for these and forISFORMULA.N,TandISREFover a table reference are unchanged.
LET, a lambda call and@can form an endpoint of:, each read as the reference it returns, and a formula that is only such a range spills the cells it covers. 0.18 refused=A9:LET(a,A2:A4,a)withParserUnexpectedToken(status 1000).
Calls that are now refused
Each of these succeeded in 0.18 and now throws without changing the workbook.
addMergeon a range that overlaps a merge (AlreadyExists), or a table, pivot, array formula or data table (PreconditionFailed).addChartwith a title of''.addTableover another table or a PivotTable (PreconditionFailed).addTablewith a name that reads as a cell address, such asA1, andaddTableor a style update naming a custom style whosetable/pivotflags exclude that kind (InvalidArgument).updateFormatDefaultswith a default column width above 255, a default row height above 409.6 points, or a base column width that is fractional or above 255 (InvalidArgument).addProtectedRange/updateProtectedRangewith a name that is empty or longer than 255 UTF-16 units, or more than 8,191 rectangles (InvalidArgument).addSparklineGroup/updateSparklineGroupwith a source or date range that is not one reference or defined name, such as a union (InvalidArgument).Setters given a value beyond Excel's limits: a row height above 409 points, a column width above 255 characters, cell text over 32,767 characters (
InvalidArgument).A name added, renamed or copied into any named collection that equals an existing one under Excel's text comparison, which folds letter case, full- and half-width forms and hiragana / katakana:
BudgetandBUDGETcollide, and so doデータandデータ(AlreadyExists).addSheet()without a name takes the smallest free number,Sheet2,Tabelle2and so on.An
.xlsbsave of a feature the binary records cannot hold fails with the newIoFeatureNotWritable(5028; PythonIoError) and writes nothing, where 0.18 saved the workbook without it. The error context'skind=names the feature. The features:- A protected range with a descriptor, name or ranges the records cannot hold.
- A sparkline source that is not one reference or name.
- A PivotTable or pivot cache the records cannot state.
- Rich-value metadata kept as stored that does not convert, which also stops an
.xlsxsave of a book read from.xlsb. setCellPictureon a workbook that keeps its rich values as stored fails the same way (.xlsbsaves that fail).
addCfRulewith an id the sheet already holds, compared without regard to case (AlreadyExists); 0.18 kept the duplicate id on both rules. A colour-scale threshold of typeAutoMinorAutoMaxinaddCfRuleorupdateCfRule(InvalidArgument), and an.xlsxsave of a rule that carries one; they are data-bar types.A chart or shape fill or line colour given without its
kind(TypeError); 0.18 dropped it.setCellStyleon a built-in style with a record that carries a differentbuiltinId(AlreadyExists).Pivot.updateFieldwith asortByFieldthat names no value field (NotFound, where 0.18 sorted by label), andsetFieldDateGroupon a field whose values are plain numbers rather than dates (PreconditionFailed).Formulas Excel refuses to enter, in cells, defined names, conditional formats and validations, fail with a parser status and
parseError:LARGE,SMALL,PERCENTILE,PERCENTILE.INC,PERCENTILE.EXC,QUARTILE,QUARTILE.INC,QUARTILE.EXC,TRIMMEANandFVSCHEDULEwith other than two arguments.- Other argument counts and reference-only arguments Excel refuses (
=ABS(1,2),=COUNTIF(1,1)). - A typed
ANCHORARRAY(...)call with or without_xlfn.(B1#is the spelling). - The error literals
#CALC!,#SPILL!,#CONNECT!,#BLOCKED!,#BUSY!,#FIELD!and#UNKNOWN!.
Pass the data of the two-argument functions as one range or array constant:
=LARGE(A1,A2,3)becomes=LARGE(A1:A2,3). A formula already stored in a file still loads, andsetErrorstill writes the newer errors.A call that returns a value rather than a reference as an endpoint of
::=A9:IFERROR(A2:A4,0)and=SORT(A2:A4):A9fail withParserInvalidReference(1004). A file that stores one keeps it, and it evaluates to#VALUE!. 0.18 accepted both with status 0 and the cell evaluated to an error.A typed reference into another workbook whose sheet name, or either end of whose span, runs past 31 UTF-16 units (
ParserInvalidReference, in a cell, defined name, conditional format or data validation). 0.18 stored it as typed and evaluated it to#REF!. A formula loaded from a file keeps such a name unchanged.A typed formula whose cell or range reference names a chartsheet, such as
=Chart1!A1or=SUM(Chart1!A1:B2)(ParserInvalidReference, in a cell, defined name, conditional format or data validation). 0.18 accepted it and evaluated it to0.Most sheet calls on a sheet that is not a worksheet (
InvalidArgument, PythonInvalidArgumentError, naming its kind).- 0.18 answered every call there: on a chartsheet or dialog sheet a cell read gave a blank, a cell write was accepted, read back and saved, and the print area read as empty.
- 0.19 refuses cell reads and writes and the other worksheet calls.
- A chartsheet answers what its own part stores (its view, tab colour, page setup, margins, header and footer, protection and chart) and returns its lists of worksheet content empty. Charts lists which of its setters apply.
kind,getVisibilityandsetVisibilitywork on every sheet, so code that walks every sheet should checkws.kindfirst.- In the CLI,
paginateon a chartsheet fails with a message that it needs a worksheet, where 0.18 exited 0 with zero pages.
A view change on a sheet that is not a worksheet (
InvalidArgument), except a chartsheet's zoom and selected tab; a patch restating the reported view is accepted and changes nothing.- On a dialog sheet, macro sheet or other sheet, reading the view is refused too.
- 0.18 read a chartsheet's or dialog sheet's view as worksheet defaults (zoom 100, not the file's), and
setSheetZoomreturned ok and read back the new zoom; on a chartsheet the change was dropped at save. - 0.19 reads a chartsheet's zoom from the file and saves a zoom change, ending zoom-to-fit.
addDataField/setDataField(Pythonadd_data_field/set_data_field, Cfm_sheet_add_pivot_data_field/fm_sheet_set_pivot_data_field) with a name that repeats another data field's name or a field's source or custom name (AlreadyExists); 0.18 stored it. An empty or blank caption counts as a name, and a data field may keep its own caption.''where 0.18 read it as absent (InvalidArgument): a hyperlinktarget(0.18's form for an in-workbook link; passnullwith alocation), a validationformula1/formula2, a sheet, workbook or protected-range hash string, a threaded comment's parent id, and a conditional-format rule'sformula1(0.18 filled a text rule's formula from it as fromnull). Omit the field or passnull(PythonNone).''in the six sheet XML setters (AutoFilter, page setup, page margins, print options, header/footer,sheetPr), where 0.18 removed the element, and for a chart series patch'sname,categoriesorx, where 0.18 removed the reference (InvalidArgument). Passnull(PythonNone, CNULL) to remove it.''in every other field where it is not a value Excel can store (InvalidArgument), among them:- A defined name's
formula(0.18 removed the name; callremoveDefinedName). - Table, pivot, slicer and default style names, picture, chart and shape names, a pivot name, a sparkline group's
dateAxisRange, totals-row labels and formulas, and pivot cache worksheet sources. - Python 0.18 sent
""asNonefor most fields and defaulted many of them to"", so code that relied on those defaults now fails the same way.
The guide's Empty strings table lists every field with its 0.18 and current meaning.
- A defined name's
A string with a lone UTF-16 surrogate, in an argument or a record field (
BindingUtf8EncodingError, 7002); 0.18 stored U+FFFD in its place. In Python a surrogate pair written as two code points is refused too. In JavaScript a string argument or field takes a string only, so anArrayBufferor a one-byte typed array isTypeError, and in both bindings a range argument that is neither an A1 string nor aCellRectisTypeError.
The other way round, addTable names a blank or repeated header Column1, Column2 and so on, where 0.18 refused it, and setRangeXfIndex accepts a rectangle of up to 134,217,728 cells, where 0.18 failed with PreconditionFailed above 1,048,576; past that, a rectangle that is not whole rows or columns is SecurityResourceLimit.
Status codes
A name or id that is taken throws
AlreadyExists, a refusal that depends on the workbook's state throwsPreconditionFailed, and an unknown object id isNotFound. A negative or past-the-end position isIndexOutOfRange(SheetIndexOutOfRangefor a sheet).A formula that does not parse fails with a parser status (1000 to 1014) and a
parseErrorposition.A conditional-format rule's, colour filter's, sort condition's or custom table style element's
dxfIndexpast the differential-format table isIndexOutOfRange; 0.18 returnedInvalidArgumentfor a table style element, and the AutoFilter setters accepted the index and wrote a dangling id.A chart series with more points than an Excel column holds is
InvalidArgument; 0.18 returnedSecurityResourceLimit.These engine ceilings return
SecurityResourceLimit(6005, PythonSecurityError) with apart=<name> requested=<n> limit=<n>context:- A page grid over 2^24 pages (0.18: status 9005, now retired).
- A PivotTable result over its cell limit (0.18:
FunctionOverflow). - A workbook past the sheet cap (0.18: status 5053, now retired).
getValuesandgetTypedValuesover 4,194,304 cells and a thread count above 8 (0.18:InvalidArgument).- A raw print-settings XML fragment over its size limit (0.18:
PreconditionFailed). - A drawing edit past the reader's part or size limits (0.18:
InvalidArgument). - An
.xlsbarray constant of more than 65,536 elements (0.18: a corrupt-file status). - A picture over 32 MiB, a sparkline group of more than 65,536 sparklines, more than 16,384 ranges in one call and more than 1,024 gradient stops in a fill.
Engine ceilings lists every
part. More than 1,026 manual page breaks on an axis isInvalidArgument, an Excel limit; 0.18 returnedPreconditionFailed.Removing the only sheet is
PreconditionFailed(9); 0.18 returned status 5052 (CannotRemoveLastSheet), which is retired.The statuses 7004 (
BindingWasmInitFailed) and 7005 to 7007 (CliInvalidArgs,CliFileNotFound,CliOutputFailed) are removed with the other codes no call returned, and the numbers stay unused. The command line reports these conditions through its exit statuses.
Function results
GROUPBYandPIVOTBYwith atotal_depthof 2 or more over a single key column return#VALUE!, as Excel does; 0.18 returned a result.- A union that contains a 3-D reference, such as
SUM((Sheet1:Sheet2!A1,B1)), returns#NAME?; 0.18 returned a number.
JavaScript and TypeScript
Behaviour that changed without an error
wb.activeSheet()returns theSheet, not its index, andwb.sheetCountis a property;wb.sheetCount()and arithmetic onactiveSheet()fail at run time, not at compile time in plain JavaScript.ThreadedComment.createdreads aCivilTimerecord (ornull) instead of an ISO string, andThreadedCommentInput.createdtakes aDateor aCivilTime, read as UTC.
Removed and renamed
createFormulon()resolves to theFormulonobject in both packages;Workbook.loadBytes(bytes)isWorkbook.load(bytes),saveAs(format)issave(format), andexcelProfileId()/setExcelProfileId()aregetProfileId()/setProfileId().- The declarations need TypeScript 5.7 or later.
- Removed with no replacement under the old name:
CfColor, the*Argbcolour keys andfillRgb/lineRgb(colours are oneColorrecord), the enumsFilterOperator,ChartBlanksAs,SparklineEmptyCellsandPivotFilterValueKind, thetodaySerialargument ofevaluateCfRange(pass{ today }),EvalArrayResultandDrawingObject.mediaPath.DatePeriod(the conditional-format date period, not the PivotTable'sPivotDatePeriod),BlanksAsandComparisonOperatoreach replace several per-feature enums and are renumbered. - The engine-level functions are members of the
Formulonobject in both packages, and the module-level exports of@libraz/formulon-nativeare gone:evalFormula(formula)isformulon.evaluateFormula(formula),version()andversionString()areformulon.getVersion(),statusString(code)isenumName(StatusCode, code),errorDisplayName(code)isErrorDisplayName[code], andlastErrorMessage()andlastErrorContext()are themessageandcontextof the caughtFormulonError.setLogMinLevelandsetLogSinkare onFormulon, and the sink receives aLogEventobject where 0.18 passed the encoded record bytes. Workbook.delete()(WebAssembly package) isdispose(), which both packages have and whichusing wb = ...calls for you.Workbook.isValid()is the propertydisposed, with the opposite sense:wb.isValid()becomes!wb.disposed.
Reshaped records
- Chart series are keyed by
seriesId, pivot filters carryvalue/valueHigh, an AutoFilter custom filter lists itsconditions, andCfMatchis a union told apart bykind. - A theme script font takes
schemein place ofmajor, and table and pivot styles are read and written withgetStyleOptions()/updateStyleOptions(patch). paginate(sheet)isws.getPagination()andPaginationResultisPagination:horizontalBreaksandverticalBreaksarerowBreaksandcolumnBreaks(records withmanual, sohorizontalBreakManualandverticalBreakManualare gone),scaleisscalePct,printTitlesisPrintTitles | null,printAreaholdsCellRectrecords, andstatusis gone because a failure throws.PaginationPagecarriesrangein place offirstRow,lastRow,firstColandlastCol, andRectPt.width/heightarewidthPt/heightPt.- Page margins are in inches:
PaginationMargins.leftInis the oldleft(points) divided by 72, and the same for the other five sides. TableEntry.headerRowCountandtotalsRowCount(numbers) areTableProperties.headerRowandtotalsRow(booleans), andTableUpdateInputisTablePatch.ChartDataSource.kindis the numberChartSourceKind, not'none','ref'or'literal', sokind === 'ref'is now silently false; compare withChartSourceKind.Ref.getCellsInRange(range, { cursor, limit })andgetInvalidCells({ cursor, limit })take aPageOptionsobject in place of positionalcursorandlimit.
Python
Everything under Changes on every surface applies, with snake_case names.
Behaviour that changed without an error
NOW(),TODAY()and every unpinned clock read use local time; 0.18 read UTC, so a program that compensated for the offset now gets it twice.- Phonetic-run and mention positions count code points; 0.18 counted UTF-16 units, so a position after an emoji moves.
wb.active_sheet()returns theSheet, not its index, andlen(wb)replacessheet_count().
Removed and renamed
- Python 3.10 or later is required (0.18 ran on 3.9).
Value.to_python()is gone (reads return native values), andColorScale,DataBarandIconSetare gone: a rule is written withCfColorScaleInput,CfDataBarInputandCfIconSetInputand read back asCfColorScale,CfDataBarandCfIconSet.- A cell is addressed positionally,
(row, col)or one A1 string;row=andcol=keyword arguments raiseTypeError. - Failures raise one
FormulonErrorsubclass per status range, andFormulaSyntaxErroris aFormulonErrorandValueErrorbut not anInvalidArgumentError;parse_referenceraises instead of returningNone. - The submodules
formulon.workbookandformulon.metadataare gone, and so is the stub fileformulon/__init__.pyi: the package carries inline annotations andpy.typed. Import every name fromformulonitself (from formulon import Workbook, Sheet). formulon.LIBis no longer re-exported. The two engine calls that needed it are module-level functions:formulon.get_version()andformulon.set_log_min_level(level).Workbook.save_as(fmt)isWorkbook.save(format=fmt).save()also takes a destination: omitted, it returnsbytes; a path or a binary file object receives the archive andsavereturnsNone. A path ending in.xlsxor.xlsbpicks the container, and any other extension needsformat=.Workbook.is_validisWorkbook.closed, a property with the opposite sense:if wb.is_valid:becomesif not wb.closed:.Workbook.iter_passthrough()andPassthroughPartare gone;wb.ooxml.list_passthroughs()returns the part paths as a list ofstr.- These functions and methods are removed:
eval_formula()isevaluate_formula(),library_version()isget_version(),get_theme()andThemeareget_theme_colors()andget_theme_fonts(), anderror_display_name(),Workbook.add_batch()withStyleBatchIndices,iter_cells()anditer_tables()have no replacement under that name. UseSheet.list_cells()orSheet.iter_rows()for cells,Sheet.list_tables()for tables, andadd_font/add_cell_xffor styles. Sheet,Table,Pivot,PivotCache,Chart,Picture,Shape,Slicer,SheetOoxmlandWorkbookOoxmlcannot be constructed; a direct call raisesTypeError, andcopy.copy,copy.deepcopyand pickling of any handle or workbook raiseTypeErrortoo. Get a handle from the workbook, and move a workbook between processes withWorkbook.load(wb.save()).Table,ShapeandSlicerwere records in 0.18 and are handles now: read their fields withget_properties().
Reshaped records
- Results that were tuples are frozen dataclasses, so tuple unpacking fails:
get_sheet_selection,get_print_titles, the table-style defaults and the pivot grand totals among them. ErrorNameisLocaleErrorName,MarginsPtisPaginationMargins,PageLayoutisPaginationPageandPaperInfoisPaginationPaper.paginate(sheet)isws.get_pagination(), and itsPaginationResultisPagination:horizontal_breaksandvertical_breaksarerow_breaksandcolumn_breaks, lists ofRowBreakandColumnBreakrecords with amanualflag (the parallel*_break_manuallists are gone),scaleisscale_pct,print_titlesisPrintTitlesorNone, andRectPt.width/heightarewidth_pt/height_pt. A page isPaginationPage.range, aCellRect, in place of four row and column fields.- Page margins are in inches, not points:
PaginationMargins.left_inis the oldMarginsPt.leftdivided by 72, and the same forright,top,bottom,headerandfooter. Code that still reads them as points gets values 72 times too small. TableProperties.header_row_countandtotals_row_count(integers) areheader_rowandtotals_row(booleans), andChartDataSource.kindis theChartSourceKindIntEnum(NONE,REF,LITERAL), not"none","ref"or"literal"; a comparison with the old string is now silently false.- The optional parameters of many methods are keyword-only, among them
Chart.update_legend,Pivot.add_field_item,Table.updateandWorkbook.update_iterative. A partial update takes keyword-only arguments that default toUNCHANGED, andNoneclears a key that can be cleared. A method that takes a record takes a dataclass (HyperlinkInput,TableInput,SheetSelection):
- wb.set_iterative(True, 100, 0.001)
+ wb.update_iterative(enabled=True, max_iterations=100, max_change=0.001)The guide's table of keyword-only parameters lists each method.
C
A C caller recompiles. Every record starts with uint32_t struct_size, set by FM_STRUCT_INIT(T) (fm_struct_init<T>() in C++). Every sheet function takes size_t sheet_index, a count getter writes the count through an out-parameter, input records go by const pointer, and an optional read reports out_present. Records are named by role: _spec_t is input, _info_t output, _t both and _patch_t a partial update whose fields carry an fm_patch_op_t. One fm_cell_rect_t replaces the per-feature range records, enum constants start with their type name, and every function that returns a pointer states how long it stays valid:
- fm_workbook_insert_rows(wb, sheet, row, count);
+ fm_sheet_insert_rows(wb, sheet_index, first, last);Behaviour that changed under the same name
fm_sheet_get_comment_at(wb, sheet_index, index, out)reads the note at a position; in 0.18 it took a row and column. The cell lookup isfm_sheet_get_comment.fm_workbook_load(bytes, len, spec, out)takes aconst fm_load_options_spec_t*before the out-parameter; passNULLfor the defaults.fm_workbook_set_defined_nametakes anfm_defined_name_trecord, and an empty formula isFM_STATUS_INVALID_ARGUMENTinstead of a removal.fm_workbook_add_sheettakes aninsert_beforeposition and returns the new index;fm_workbook_move_sheet's second argument isinsert_before, not the final index.fm_sheet_set_row_outlinetakes afirst,lastspan and auint32_t level, andfm_sheet_set_column_outlineauint32_t level; a level above 7 isFM_STATUS_INVALID_ARGUMENT.fm_sheet_set_range_xf_indexandfm_sheet_remap_range_xfsreturnFM_STATUS_SECURITY_RESOURCE_LIMITwhere 0.18 returnedFM_STATUS_PRECONDITION_FAILED.fm_sheet_get_cell_countandfm_sheet_get_cell_atcount and list a blank cell only while it has a format of its own, and list a coordinate that has only a format as a blank value with aNULLformula.- An absent string in a result record reads
NULLinstead of"".
Removed and renamed
| Before | After | Note |
|---|---|---|
fm_workbook_save_as, FM_WORKBOOK_FORMAT_UNKNOWN | fm_workbook_save | fm_workbook_save takes the format. |
fm_workbook_evaluate_formula | none | fm_sheet_evaluate_formula_array returns a scalar as a 1 by 1 array. |
fm_sheet_set_zoom | fm_sheet_update_view | A zoom outside 10 to 400 is FM_STATUS_INVALID_ARGUMENT instead of being clamped. |
fm_sheet_get_image | fm_sheet_get_picture | Reports a missing picture as FM_STATUS_OK with *out_present = 0. |
fm_formula_localize, fm_formula_canonicalize | fm_localize_formula, fm_canonicalize_formula | Take an fm_reference_notation_spec_t. |
fm_sheet_add_hyperlink | fm_sheet_set_hyperlink(wb, sheet_index, hl) | No cell arguments and no NULL form. fm_sheet_remove_hyperlink(wb, sheet_index, range) takes a rectangle. |
fm_text_compare, fm_collation_classes | fm_compare_text, fm_get_collation_classes | Take the strength before the profile id. |
fm_workbook_pivot_field_set_date_group | fm_sheet_set_pivot_field_date_group | Takes a mask of periods. |
fm_sheet_set_chart_display | fm_sheet_update_chart_display | Takes a patch. |
fm_workbook_set_cell_phonetic_runs | fm_sheet_set_cell_phonetic_runs | Takes an fm_text_offset_unit_t before the runs; fm_sheet_add_threaded_comment takes one too. |
fm_status_string(status) | fm_get_status_name(status) | Both return a static string. |
fm_sheet_set_freeze, _set_split, _set_top_left, _set_pane_top_left, _set_view_mode, _set_show_grid_lines, _set_show_formulas, _set_show_zeros, _set_show_outline_symbols, _set_show_row_col_headers, _set_right_to_left, _set_tab_selected | fm_sheet_update_view | The single-property view setters are removed: fill an fm_sheet_view_patch_t (each field with its _op) and call fm_sheet_update_view. |
fm_sheet_set_tab_hidden | fm_sheet_set_visibility | Takes the whole tab state (visible, hidden or very hidden). |
fm_workbook_clear_pinned_now(wb) | fm_workbook_set_pinned_now(wb, NULL) | |
fm_workbook_paginate | fm_sheet_paginate | |
fm_pagination_horizontal_break_*, fm_pagination_vertical_break_*, with their _is_manual readers | fm_pagination_get_row_break_count / _at, fm_pagination_get_column_break_count / _at | Fill an fm_row_break_t or fm_column_break_t whose manual field carries the flag. |
Reshaped records
fm_color_treplacesfm_cf_color_tand the*_argbfields of the label font records, and the chart fill and line records (fm_chart_fill_t,fm_chart_line_tand their patches) carry anfm_drawing_color_tascolor, so every record embedding one changes layout. The shape fieldsfill_rgb/line_rgbarefill/line.fm_sheet_get_print_areafillsfm_cell_rect_trecords andfm_sheet_get_print_titlesanfm_print_titles_t, instead of A1 text.fm_sheet_update_protected_rangeaddresses the range by name and takes a patch;rangesleftNULLkeeps the stored ranges.fm_pagination_marginsfilled anfm_margins_ptin points;fm_pagination_get_marginsfills anfm_margins_pt_info_tin inches (left_in,right_in,top_in,bottom_in,header_in,footer_in). Divide an old value by 72 to compare.fm_workbook_saveandfm_workbook_save_with_diagnosticstake a non-constfm_workbook_t *, because a save changes the workbook: it computes pending values, recalculates a manual workbook that hascalcOnSaveset, and writes stale PivotTables into their cells before anything is written. A failed write keeps those changes, and a retry writes the same bytes. C callers compile unchanged; a C++ caller that holds only aconst fm_workbook_t *needs a non-const pointer.
Collisions and state conflicts return FM_STATUS_ALREADY_EXISTS and FM_STATUS_PRECONDITION_FAILED. C ABI changes lists each function and record.
Command line
- Exit statuses are fixed:
0success,1a request the engine refused,64a usage error,65a formula that does not parse ineval,66an input file that cannot be read and73/74an output or stream error. 0.18 exited1for all of these but usage errors, so a script that tests for1misses them. --formulas,--values,--sheetsand--metadataare removed and exit64;dumptakes one--viewoption:
- formulon dump --values book.xlsx
+ formulon dump --view values book.xlsx- Every
--jsonoutput is an object with"format": 1, thepaginatekeys changed,dump --view metadatawritesdefinedNamesandpassthroughPartsin camelCase, andrecalc --jsonwrites its warnings to standard output instead of standard error. formulon --versionprintsformulon <version>, an input named-reads standard input and-o -writes standard output, andrecalc -opicks the format from.xlsxor.xlsb(or--format).
See Command line for every output key that changed.
What was added
Workbook.load(bytes, { profileId })(PythonWorkbook.load(source, profile_id=...), Cfm_load_options_spec_t.profile_id) loads a workbook under a profile without making any formula stale, and the CLI applies--profilewhen it loads the file (Workbook lifecycle).- A JavaScript
Dateand a Pythondate,datetimeortimecan be written to a cell. Written to a General cell, aDatetakes the built-in short date (id 14,m/d/yyunder en-US) at local midnight and the date and time (id 22) otherwise; a Pythondatetakes 14, adatetime22 and atimeh:mm:ss(21). Sheet.insertCells(range, shift)anddeleteCells(range, shift)(Pythoninsert_cells,delete_cells; Cfm_sheet_insert_cells,fm_sheet_delete_cells) move the cells of a band with aCellShift:DownorRightinsert,UporLeftdelete. A whole-row or whole-column range behaves asinsertRowsorinsertColumns. A shift that does not fit the call, or that cuts into a table, legacy array block, data table or PivotTable, isInvalidArgumentorPreconditionFailedand leaves the workbook unchanged.ws.listCircularReferences()andws.isCellStale(row, col)(Pythonlist_circular_references,is_cell_stale; Cfm_sheet_get_circular_reference_count/_at,fm_sheet_is_cell_stale) list the cells of an unresolved cycle and tell whether a formula cell holds an outdated value under manual calculation (Recalculation).wb.getCompatibilityVersion()/setCompatibilityVersion(version)(Pythonget_compatibility_version,set_compatibility_version; Cfm_workbook_get_compatibility_version,fm_workbook_set_compatibility_version) read and set Excel's Compatibility Version, saved in.xlsxand.xlsb..xlsbsaves write print settings, AutoFilters, notes and threaded comments, and custom table styles from the workbook (XLSB).- PivotTables and their caches in an
.xlsbfile are read into the model, so they can be inspected, edited and refreshed, and an.xlsbsave writes them from it; a PivotTable with a feature the engine does not write to.xlsbyet is left out with its cache and reported (PivotTables).wb.ooxml.listPassthroughs()lists only the parts the model does not hold. getValues(range)returns a dense grid withBlankfor empty cells, andsetValues(a1, values)writes one.hasDirtyCells()(Pythonhas_dirty_cells()) reports edits made since the last fullrecalc.- A table, pivot, conditional-format rule, validation or protected range is addressed by position or by key (
removeTable('Sales'),removePivot('Pivot1')). Pivot.getSpill()(Pythonget_spill; Cfm_sheet_get_pivot_spill) reads the range a pivot report covers, or needs when blocked, andSheet.getSpillreports it at the report's anchor.Spill.anchor(Cfm_spill_info_t.anchor) is the cell holding the dynamic-array formula, or a PivotTable report's anchor cell.Spill.cause(Cfm_spill_info_t.cause) says what blocks a spill or a pivot report:SpillCause.Occupied,MergedorBeyondEdge, andnullwhen nothing does. A spill or report blocked past the sheet edge is now reported, its range clipped to the grid.- Saved XLSX and XLSB files carry Excel's rich error values for
#SPILL!,#CALC!and a#VALUE!with a reason, and loading reads them back, so a blocked spill or pivot report stays blocked across a save (File formats). Pivot.getPageFieldOrder()andsetPageFieldOrder(indices)(Pythonget_page_field_order,set_page_field_order; Cfm_sheet_get_pivot_page_field_order,fm_sheet_set_pivot_page_field_order) read and write the page-axis order; the Values level isInvalidArgumentthere.wb.getLocation()/setLocation(location)(Pythonget_location,set_location; Cfm_workbook_get_location,fm_workbook_set_location) hold where the workbook is saved, aWorkbookLocationwithdirectoryandfileName. It drivesCELL("filename"),CELL("address")for other sheets and theBook.xlsx!Namespelling (Formula language).ReferenceNotationOptions{ r1c1, baseRow, baseCol }(Pythonr1c1=,base_row=,base_col=; Cfm_reference_notation_spec_t) is the one options type ofparseReference,localizeFormulaandcanonicalizeFormula.ws.ooxml.listCellXfIndices(range?)andws.listShowPhoneticCells(range?)(Pythonlist_cell_xf_indices,list_show_phonetic_cells) list the stored cells with a cell XF or the Show Phonetic flag, blanks included. Their C functions,fm_sheet_get_cell_xf_indicesandfm_sheet_get_show_phonetic_cells, take a requiredrange; pass the whole grid to list every stored cell.FormulonOptions.wasmtakes the module bytes or aWebAssembly.Module, for Workers and other hosts that cannot locateformulon.wasm.convertCivilToSerialandconvertSerialToCivil(Pythonconvert_civil_to_serialandconvert_serial_to_civil) convert between a calendar date and time and an Excel serial, for either date system.- Every drawing has
update(patch)for its name, description, hidden flag and anchor;Picture,ChartandShapehavesetZOrderandsnapshot, andSlicerhassetZOrder. wb.sheetCount,wb.hasSheet(ref),formulon.listProfileIds(),wb.listThemeScriptFonts(scheme),ws.getVisibility()/setVisibility(),ws.updateValidation()/updateCfRule(),pivot.getField()/getDataField()/getFilter(),cache.getRecordValue(),ooxml.setFill()/setBorder()/setCellXf()/setDxf()and, in C,fm_sheet_set_value.getCellRectPtandgetWidthModeltake an optionalmodethat defaults toGeometryMode.Display.getTypedValue,getDate,getUsedRange,iterRows,getTabColor,setTabColor,enumNameand theExcelErrorclass in JavaScript, and the Python equivalents; aWorkbookiterates its sheets, andgetMemoryUsageis on the WebAssembly package as on the native one.eval -reads a formula from standard input,eval --in FILEevaluates against a workbook,dump --range A1:B2limits the dump, and--localaccepts localized formula text.- A WASM
Workbookyou forget to dispose may now be released at garbage collection, as the native package already does. See API conventions.