1
votes

I started to work with the Custom Functions with office js api, and I have a few questions.

I have a scenario, where I might need to refresh all the custom function formulas values after clicking on the add-in button in the excel Ribbon. Is there a way to do that from function-file.js or any other way in general?

Also what would be a good approach to share the state between custom-functions.js or any other part of your add-in? I have been trying to use OfficeRuntime.AsyncStorage for this purpose, but the problem is that office.js library do not have AsnycStorage defined in it, and AsyncStorage can only be accessed from custom functions, caused it is defined in the Custom functions runtime.

1

1 Answers

1
votes

thanks for asking about custom functions and trying them out! To pick up all changes in your functions (and see an update in the cells that use these functions), you will need to re-sideload the project. (See docs on sideloading here) We recognize that this process could be improved - so, our engineering team is working on a "live reload" that will be coming in the future.

RE: OfficeRuntime.AsyncStorage - it is accessible to all parts of an add-in (so, both custom functions and non-custom functions parts of an add-in, like UI elements such as the task pane can use it). We've got some documentation on AsyncStorage currently here.

Let me know if you have additional questions - thanks!