How to Fix Excel Add-in Errors Opening XLSM Files on the Web
Question details
Users experience failures when an Excel JavaScript add-in attempts to open XLSM files in Excel for the web.

- Product
- Excel for the Web
- Device & OS
- not provided
- Scenario
- Using an Excel JavaScript add-in to create or open an XLSM workbook via the Excel.createWorkbook API in a web browser.
- Observed behavior
- The XLSM file opens successfully in the desktop version of Excel, but the add-in fails or throws an error when executing the same operation in Excel for the web.
Verify whether your workbook explicitly requires VBA macros to function, as web environments natively restrict macro execution for security and architectural reasons.
Convert the XLSM File to XLSX Format
Since Excel for the web does not support running macros, saving the file as a standard XLSX format avoids the compatibility conflict causing the add-in to fail.
Excel for the web has highly limited support for XLSM files. While you can view them, background macros cannot run. When you use the Excel.createWorkbook API via a JavaScript add-in on an XLSM file, this web limitation often triggers an unexpected failure.
Launch the original XLSM file using your desktop version of Microsoft Excel.
Click on 'File' in the top left corner, select 'Save As', and choose your preferred destination.
In the file format drop-down menu, choose 'Excel Workbook (*.xlsx)' and click 'Save'.
Modify your JavaScript add-in's code to target the newly created XLSX file instead of the unsupported XLSM file.

Force the File to Open in Excel Desktop App
Bypass the web-based API limitations entirely by redirecting users to the Excel desktop application where macro-enabled workbooks are fully supported.
Handle Macro-Enabled Workbooks Smoothly with WPS Office
If web-based Excel limitations are slowing down your workflow, consider using WPS Office. It provides a robust, desktop-grade spreadsheet environment that natively handles complex formatting and macro-enabled files without the hassle of web restrictions.
- 1. Download the Installer: Visit the official WPS Office website and download the free version tailored for your operating system.
- 2. Install WPS Office: Run the setup file and follow the brief on-screen instructions to complete the lightweight installation.
- 3. Open Your XLSM Files: Launch WPS Spreadsheets, click 'Open', and select your macro-enabled workbook to begin editing without web-based compatibility errors.

Frequently Asked Questions
Why does Excel.createWorkbook fail specifically with XLSM files on the web?
Excel for the web restricts macro execution for security and performance reasons. When an add-in tries to generate or interact deeply with an XLSM file via the createWorkbook API, the web architecture rejects it, causing the add-in to throw an error.
Can I run VBA macros in Excel for the web if I change my browser settings?
No, VBA macros cannot run in Excel for the web regardless of your browser settings. The web application simply lacks the VBE (Visual Basic Environment) engine required to interpret and execute VBA code.
How do I replace my VBA macros for users restricted to Excel for the web?
To automate tasks for web users, you should migrate your existing VBA scripts to Office Scripts (which use TypeScript) or rebuild the logic directly into your Excel JavaScript add-in.




