Skip to content

Recalculate a Workbook

Recalculation starts with bytes, not with a desktop application.

Test with a real workbook early

Single-formula tests prove the package loads. A representative workbook proves whether file structures, formulas, and locale assumptions fit your use case.

Bytes inWorkbook.loadBytes /Workbook.loadMutate cellsrecalc()save()Bytes outBytes inWorkbook.loadBytes / Workbook.loadMutate cellsrecalc()save()Bytes out

JavaScript / WASM

ts
import createFormulon from '@libraz/formulon'

const Module = await createFormulon()
const workbook = Module.Workbook.loadBytes(xlsxBytes)

try {
  if (!workbook.isValid()) {
    throw new Error(Module.lastErrorMessage())
  }

  workbook.setNumber(0, 3, 1, 125000) // sheet 0, B4
  workbook.recalc()

  const saved = workbook.save()
  if (!saved.status.ok || saved.bytes === null) {
    throw new Error(saved.status.message)
  }

  await upload(saved.bytes)
} finally {
  workbook.delete()
}

Python

python
from formulon import Workbook

with open("input.xlsx", "rb") as f:
    blob = f.read()

with Workbook.load(blob) as wb:
    wb.set_number(0, 3, 1, 125000.0)
    wb.recalc()
    output = wb.save()

with open("output.xlsx", "wb") as f:
    f.write(output)

CLI

sh
formulon recalc input.xlsx -o output.xlsx
formulon dump --values output.xlsx

The engine preserves workbook structure while updating calculated values. Use this path for server-side checks, browser uploads, batch conversions, and regression tests against known workbooks.

Run the round trip here

The panel below performs that same sequence in the browser: pick a workbook — or let it generate the sample — and the bytes are parsed with loadBytes(), recalculated, and serialized back to .xlsx bytes you can download. The sheet under the panel is those serialized bytes reopened in an embedded formulon-cell grid, so the values on screen are what the engine computed rather than what the file happened to carry.

Load an xlsx and recalculate it

Nothing is uploaded. Parsing, recalculation and serialization all happen in this page’s WASM engine, and the bytes never leave your browser.

Powered by the real Formulon engine (WASM) — it runs entirely in your browser, nothing is uploaded.