OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
670 stars 96 forks source link

Office JS addin Custom functions not working in compatibility mode #4895

Open YogiGoodman opened 5 days ago

YogiGoodman commented 5 days ago

Your Environment

Expected behavior

We want to use XLL addin and it's custom functions when XLL addin is available and the same should switch to offices js addin custom functions when XLL addin is unavailable or workbook is open in Web or on Mac.

Current behavior

When we updated manifest xml with equivalent addin, the office js addin custom functions stopped working completely.

Even if XLL addins file name is correct or incorrect, even if XLL addin is installed or not custom functions registered with office js addin are unavailable.

Steps to reproduce

We tried using this documentation on office js but it didn't help : https://learn.microsoft.com/en-us/office/dev/add-ins/excel/make-custom-functions-compatible-with-xll-udf

  1. Create office js addin with Yo generator with sample add custom function.
  2. Create an XLL addin with same namespace and same custom function. The namespace, custom function name and its definition is exactly same in both the addins.
  3. Update manifest xml to support compatibility using equivalent addin tag
  4. Open an workbook with custom functions using office js.
  5. Try typing custom functions name using =AddinNameSpace.CustomFn(param1,param2)
  6. Expected to above formula to work with office js addin, but Excel is not recognizing this formula. The custom fns are not registered, even though the XLL addin is unavailable.

Context

We want to use XLL addin and it's custom functions when XLL addin is available and the same should switch to offices js addin custom functions when XLL addin is unavailable or workbook is open in Web or on Mac.

Following this documentation : https://learn.microsoft.com/en-us/office/dev/add-ins/excel/make-custom-functions-compatible-with-xll-udf

shanshanzheng-dev commented 3 days ago

Hi @YogiGoodman Thanks for reporting this issue, we'll take a look and report back if we have a suggestion for you.