Fix Excel Office.js Custom Functions Not Working After Deployment
Question details
Users report that an Excel Office.js add-in containing custom functions stops working after deploying updates to an on-premises server, requiring a manual cache clear.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Deploying script and manifest updates for an Office.js add-in hosted on an on-premises server.
- Observed behavior
- Custom functions fail to execute after deployment until users manually clear their browser or Office add-in cache.
Ensure you have administrator access to the on-premises deployment server and verify that your updated manifest and script files are successfully hosted before attempting cache invalidation steps.
Implement Programmatic Cache Invalidation
Prevent caching issues automatically by configuring cache-control headers on your server or appending version queries to your script URLs.
Since Excel relies on embedded browser controls (like Edge WebView2) to run Office.js add-ins, it heavily caches web assets. Enforcing strict caching rules on the server side ensures clients always fetch the latest custom functions.
Configure your on-premises web server (e.g., IIS, Apache) to serve the add-in files (HTML, JS, CSS) with 'Cache-Control: no-cache' or appropriate max-age settings to prevent stale loading.
In your add-in's main HTML file, append a version query string to the JavaScript references (for example, <script src='functions.js?v=2.0'></script>). Update this string on every deployment to force the client to fetch the new file.
Increment the <Version> node in your XML manifest file. When the updated manifest is deployed to the Microsoft 365 admin center or shared network folder, Excel will force-reload the add-in and clear its context cache.

Clear the Office Cache Manually
Instruct users or IT admins to clear the Office add-in cache to immediately resolve the issue for affected machines.
Try WPS Office for a Streamlined Spreadsheet Experience
While handling complex Office.js deployment and caching issues can be frustrating, you might want a lightweight and highly compatible alternative. WPS Office offers a free, easy-to-use suite with robust spreadsheet functionality and seamless Microsoft Excel compatibility.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your device.
- 2. Install the Application: Run the installer and follow the simple on-screen instructions to set up the suite.
- 3. Open Your Spreadsheets: Launch WPS Spreadsheets and open your existing Excel workbooks with full format compatibility.

Frequently Asked Questions
Why do my Excel custom functions stop working after deploying to an on-premises server?
When deploying updates, Excel and the underlying webview often cache the previous version of your JavaScript files. If the new custom functions are called but the old script is still cached, the execution fails until the cache is cleared.
How can I prevent users from needing to manually clear their Office cache?
You can implement programmatic cache invalidation by updating the version number in your XML manifest, configuring 'no-cache' headers on your on-premises server, or appending a version query string to your JavaScript references in the HTML file.
Where is the best place to ask advanced Office.js API questions?
For specialized JavaScript API and Office Development troubleshooting, you should post your questions in the Microsoft Q&A community under the Office Development tags to get support directly from developers.




