---
title: "Spreadsheet editor in Document Authoring"
canonical_url: "https://www.nutrient.io/guides/document-authoring/spreadsheets/editor/"
md_url: "https://www.nutrient.io/guides/document-authoring/spreadsheets/editor.md"
last_updated: "2026-10-14T00:00:00.000Z"
description: "What the Document Authoring spreadsheet editor includes, and how to switch spreadsheets or remove the editor."
---

# Spreadsheet editor

Create the spreadsheet editor with [`createSpreadsheetEditor()`](https://www.nutrient.io/api/document-authoring/types/docauthsystem/#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](https://www.nutrient.io/guides/document-authoring/spreadsheets/getting-started.md) 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](https://www.nutrient.io/guides/document-authoring/spreadsheets/save-and-export.md#download-an-exported-file) section in the save and export guide.

## Switch spreadsheets and remove the editor

Use [`setCurrentSpreadsheet()`](https://www.nutrient.io/api/document-authoring/types/docauthspreadsheeteditor/#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:

```js

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

editor.setCurrentSpreadsheet(nextSpreadsheet);

```

Call [`destroy()`](https://www.nutrient.io/api/document-authoring/types/docauthspreadsheeteditor/#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:

```js

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](https://www.nutrient.io/guides/document-authoring/spreadsheets/formulas.md)**\
See which functions calculate in the editor.

**[Save and export](https://www.nutrient.io/guides/document-authoring/spreadsheets/save-and-export.md)**\
Store spreadsheets as SheetJSON, and export XLSX and PDF.
---

## Related pages

- [Spreadsheets](/guides/document-authoring/spreadsheets.md)
- [Spreadsheet formulas](/guides/document-authoring/spreadsheets/formulas.md)
- [Get started with spreadsheets](/guides/document-authoring/spreadsheets/getting-started.md)
- [Import and load spreadsheets](/guides/document-authoring/spreadsheets/import-and-load.md)
- [Spreadsheets in Node.js](/guides/document-authoring/spreadsheets/nodejs.md)
- [Save and export spreadsheets](/guides/document-authoring/spreadsheets/save-and-export.md)
- [Spreadsheet JSON support with SheetJSON](/guides/document-authoring/spreadsheets/sheetjson.md)

