3

I'm quite new working with the Office.js API. I created a React add-in project and I'm now trying to add a custom function which can simply add two cells just like the examples at create custom function in Excel. In this guide it says you have to create the add-in project as Excel Custom Functions

So my doubt is how can I create a custom function if the add-in project I created is React type instead of Excel Custom Functions

1 Answer 1

1

Yes, you definitely can. Currently, it means merging existing templates (react template and the one at custom functions template which are both available via yo office) and as feature moves out of preview we will have explicit guidance on https://aka.ms/customfunctions.

For now there are 4 things:

  1. modify your manifest to add the customfunctions under the "allformfactors" element
  2. add an customfunctions.html file which can load your JavaScript
  3. add the customfunctions.json file
  4. add a reference to your JavaScript
Sign up to request clarification or add additional context in comments.

2 Comments

Is there any example on how to get that merge done? I tried to do the 4 stepts you mention but couldn't reach the CustomFunction object in order to do the associate.
@Keyur Patel - MSFT - Could we get an updated answer to this as the structure of Excel add-in projects have changes since this was posted (there is no longer a customfunctions.json file, ect.). There is still no yeoman office template for creating an Excel Custom Functions project with a React Taskpane. Attempts I have made to go from a React Taskpane project to adding Custom functions and vice versa (from a Custom Functions project to adding a React Taskpane) have both failed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.