Open Excel files in React Spreadsheet

19 Nov 20262 minutes to read

The React Spreadsheet Editor component allows users to select and open workbook files through the user interface or the public open() method. The same UI and public API are used for both client-side and server-side approaches. The approach used is determined by whether openUrl is configured.

When openUrl is configured, the Spreadsheet sends files to a server endpoint for processing (server-side processing). When openUrl is not configured, the Spreadsheet processes files directly in the browser (client-side processing).

Enable file opening

To enable opening Excel files, set the allowOpen property to true. The default value is true, so this property typically does not need to be explicitly set unless you want to disable file opening.

  • Use Ctrl + O keyboard shortcut to open Excel documents.

Open a file from the user interface

To open a workbook from the user interface, select File > Open from the ribbon and choose a file.

The processing method depends on the Spreadsheet configuration. When openUrl is not configured, the file is processed in the browser. When openUrl is configured, the file is sent to the specified Open service.

Open a file programmatically

Use the open method to open a file programmatically. Pass the file through the file property of OpenOptions.

The File object can come from a local file selection or be created from application-provided data.

Open events

  • Use the beforeOpen event to customize or cancel the Open operation before the selected file is processed.
  • Use the openComplete event to perform an action after the workbook is loaded.

Supported file formats

The supported file formats depend on the selected processing method:

Processing method Supported formats
Client-side processing Microsoft Excel Workbook (.xlsx)
Server-side processing Microsoft Excel Workbook (.xlsx), Excel 97-2003 Workbook (.xls), Comma-Separated Values (.csv), Excel Macro-Enabled Workbook (.xlsm), and Excel Binary Workbook (.xlsb)

See also