Excel desktop version on Windows refuses to load and parse custom functions metadata file (functions.json)
Prerequisites
I am converting some VSTO Excel plugin to use the new JS API. The current plugin has 500+ UDFs that need to be converted into custom functions. I have created a functions.json metadata file describing all these custom functions and have run into the problem that the windows version of Excel refuse to load this functions.json file if it exceeds 1 MB. I couldn't find any mention of the limitations in Excel's documentation and couldn't find anyone who had encountered this problem. This is so frustrating, especially since the same project with the same functions.json file works fine in the web version of Excel
- [x] I am running the latest version of Node and the tools
- [x] I checked the documentation and found no answer
- [x] I checked to make sure that this issue has not already been filed
Expected behavior
Excel will load and parse all custom functions from functions.json successfully
Current behavior
No custom function has added to Excel (desktop version)
The web version of Excel works without errors or complaints about loading custom functions. All provided functions are visible in the document
Steps to Reproduce
- Create node project using yeoman generator with custom functions shared runtime template
- Add 500 functions description in
src/functions/functions.ts - Check that
functions.jsongenerated by custom-functions-metadata-plugin indistfolder is more than 1 Mb - Run devserver with side-loading your add-in to Excel (desktop and web versions)
Context
- Operating System: Windows 11
- Node version: Node 18.20.3
- Office version: Excel for Microsoft 365 MSO (Version 2406 Build 16.0.17726.20078) 64-bit
- Tool version: custom-functions-metadata-plugin 1.7.0
Thanks for reporting this @Yuri2b.
@grangeryy, could you please investigate?
Hey guys, do you have any updates on this? Have you managed to reproduce?
@Yuri2b Thanks for report this issue and waiting for a long time. I can't repro this issue use my local environment and we didn't heard such similar issue recently. Is that possible to provide the manifest or CF metadata files for us to continue investigate?
And we'd like to suggest you also post your question here to get more attentions and it will well triaged: Office-Js Issues Also, there is a tool for you to local debug, it will provide more error information there: Debug your add-in with runtime logging What's more, could you help to check if reduce the json file to below 1M could resolve it? We currently have the 1M limitation for metadata file.
Is that possible to provide the manifest or CF metadata files for us to continue investigate?
This CF file causes an error, its size is 1 MB (1 052 400 bytes). If you remove an arbitrary function from json file and make this file size less then 1 MB (1 048 576 bytes I guess) - it will be loaded without any error and all presented functions will be available.
How I reproduce it:
- Build project with
npm run build - Place my manifest file to shared folder to side-load it manually
- Modify my hosts file by adding 127.0.0.1 -> www.contoso.com reference
- Run flashspys/nginx-static in docker with /dist folder mounted to /static
- Side-load the add-in in Excel
- Toy with dist/functions.json size and try to remove/load the add-in again
@Yuri2b Thanks for the information. If reducing file could resolve the issue, it should be the case. Currently we have a size limitation for the metadata of 1MB.
Currently we have a size limitation for the metadata of 1MB.
Oh, so if you have this limitation - there is no need to raise a new issue on Office-Js Issues right? Is this behavior documented somewhere? And are there any ways to overcome this limitation? It's a really blocker for what I'm working on now
I searched around and didn't find the document. I will open a ticked internally to add it. For workaround, currently we don't have it. We did some test before and found that around 20k CF may hit the limitation. So we'd like to suggest you to help reducing some description in the metadata file may helps.
Dear @XuanZhouMSFT, @AlexJerabek,
My team is also in the process of migrating a relatively large financial suite from VSTO and Excel-DNA to Office JS. This suite includes hundreds of functions, and we've encountered the same limitation with the functions.json metadata file size (1 MB).
This restriction is proving to be a significant blocker for us. While we could reduce the metadata file size by removing meaningful information such as descriptions and parameter types, this would severely impact the user experience. Valuable context that users rely on when interacting with the functions through Excel's standard UI would be lost.
As Microsoft is actively moving away from VSTO (e.g., with Outlook recently stopping support for VSTO), we feel it’s essential to adopt the new Office JS framework to future-proof our add-ins. However, this size limitation makes it impossible to fully migrate our solution at the moment.
Could you please let us know if there are any plans to increase the metadata file size limit? Addressing this limitation would be incredibly helpful for large-scale add-ins like ours and align with Microsoft’s broader transition away from VSTO.
Thank you for your time and attention!