This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/document-authoring/spreadsheets/editor.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Spreadsheet editor in Document Authoring

Create the spreadsheet editor with createSpreadsheetEditor(), and pass it the spreadsheet to display through the spreadsheet option. The editor provides its own user interface.

Before you start, install and run the Document Authoring library in your app. If you haven’t set it up, refer to the getting started guide.

What the editor includes

The editor toolbar provides zoom, undo and redo, font and color controls, borders, alignment, text wrapping, merging, number formats, and download. The View menu toggles gridlines, and Page setup controls page settings.

The editor also provides a formula bar, sheet tabs, context menus, and standard spreadsheet keyboard shortcuts. Copy and paste work within the editor and between the editor and other apps.

The download menu exports the current sheet as a PDF or the entire spreadsheet as an XLSX file. It names files spreadsheet.pdf or spreadsheet.xlsx.

To choose a file name or export every sheet, refer to the download an exported file section in the save and export guide.

Switch spreadsheets and remove the editor

Use setCurrentSpreadsheet() to display another spreadsheet in the editor. The spreadsheet must come from the same system as the editor. Otherwise, the method throws an error and keeps the current spreadsheet:

const nextSpreadsheet = await system.importSpreadsheet(nextFile, {
fileName: nextFile.name,
});
editor.setCurrentSpreadsheet(nextSpreadsheet);

Call destroy() when the view containing the editor closes. This removes the editor’s elements and event listeners. You can call this method more than once:

editor.destroy();

Destroying the editor doesn’t destroy the system. Reuse the system for another editor, and call system.destroy() when your app no longer needs Document Authoring.

Learn more

Formulas
See which functions calculate in the editor.

Save and export
Store spreadsheets as SheetJSON, and export XLSX and PDF.