logo
search
Excel Error Codes

Fix Office.js Worksheet.copy GeneralException in Excel Web Add-ins

WPS Content ManagerWPS Content Manager Oct 10, 2026 868 views

Question details

The user needs to resolve a 500 GeneralException error that occurs when copying a worksheet into a blank workbook using Office.js in an Excel web add-in.

How to Fix Office.js Worksheet.copy GeneralException in Excel
Product
Excel Web Add-ins
Device & OS
not provided
Scenario
Developing or running an Angular-based Excel web add-in that relies on the Office.js API to copy an existing worksheet into a new, blank workbook.
Observed behavior
The application throws a 500 GeneralException specifically during the Worksheet.copy execution.
Before you start

Ensure you have a stable internet connection if loading Office.js from a CDN, and back up your project files before updating any npm packages or library versions.

Solution 1Recommended

Update the Office.js Library to the Latest Version

Outdated library versions can cause unexpected exceptions with newer Excel APIs. Updating ensures compatibility and includes the latest bug fixes.

A 500 GeneralException often implies a mismatch between the add-in library version and the Excel host capabilities. Ensuring you are using the latest stable release of the Office.js API can resolve underlying compatibility issues with the Worksheet.copy function.

1
Update via CDN

If you are loading the library directly in your index.html, update the script tag source to the latest official endpoint: https://appsforoffice.microsoft.com/lib/1/hosted/office.js

2
Update via NPM

If you are using Node.js for your Angular project, open your terminal and run 'npm install @microsoft/office-js@latest' to fetch the newest version, such as version 1.1.88 or higher.

3
Clear Add-in Cache

Clear your browser cache or the Office client cache (depending on where you are testing the add-in) before reloading your application to ensure the new scripts are fully loaded.

Update the Office.js Library to the Latest Version
Version Check: Always verify the minimum requirement set in your add-in manifest to ensure it aligns with the updated Office.js version.
Free Microsoft Office alternative

Try WPS Office for Seamless Spreadsheet Management

While troubleshooting complex Office.js API exceptions in Excel, consider using WPS Office as a lightweight, highly compatible alternative for your daily spreadsheet and documentation needs. It provides a familiar interface and flawless compatibility with standard Microsoft formats without the heavy overhead.

Highly compatible with Microsoft Excel formats (.xlsx, .xls) and CSV files.Free and lightweight, consuming fewer system resources for faster performance.Familiar user interface that requires practically no learning curve.Robust built-in formula library and powerful data analysis tools.
microsoft office alternative - wps office

Frequently Asked Questions

What causes a GeneralException in Office.js?

A GeneralException is a catch-all error in Office.js that typically indicates an internal failure within the host application (like Excel), an invalid API parameter, or a mismatch between the library version and the host capabilities.

Can I copy a worksheet to a newly created blank workbook using Office.js?

Yes, but the target workbook must be properly initialized and fully loaded in the Excel web context before the Worksheet.copy method is invoked. A missing context reference often leads to execution failures.

How do I report a persistent Office.js bug?

If standard troubleshooting fails, you can submit a reproducible sample code snippet along with your environment details (OS, Excel version, build number) to the official Office.js GitHub repository or the Microsoft developer community.