3

I have followed the guide for creating a custom functions project: https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/excel-custom-functions-quickstart?tabs=excel-windows

When I run npm run start:desktop Excel opens. The Excel instance can show a taskpane from the addin. When Excel opens the status bar says "Add-ins loaded successfully" but after a while it changes to "Error installing add-ins". And when I enter =CONTOSO.ADD(10,200) into a cell no formula with that name exists.

Do you have any idea what might be the problem or what would be good next steps for troubleshooting? I have already tried clearing Office cache.

EDIT 1: To clarify in response to a comment, I believe that the web server is started when I execute npm run start:desktop. The foreground process starts Excel and then exits soon after with the output in the screenshot.

enter image description here

user1283776
  • 19,640
  • 49
  • 136
  • 276

1 Answers1

0

I did follow the same article, just to check this out. I noticed that your screenshot doesn't have the line Enabled debugging for add-in a6778cd6-b54f-4602-8dd2-919218581f2c.

App type: desktop
Enabled debugging for add-in a6778cd6-b54f-4602-8dd2-919218581f2c.
Starting the dev server... (webpack serve --mode development)
Sideloading the Office Add-in...
Debugging started.

which may be because something missing in the source, that has setup by yo office or some issue/incompatibility of node-modules like office-addin-debugging, webpack.

So I would suggest to run npm run stop and make sure no developer add-ins are listed under My Add-ins and clear that cache manually.

Then try to create the same sample in another folder by running the yo office and follow the steps from there onwards.

Before you run npm run build, delete the package-lock.json file. There should be another window (webpack) open once you run the npm run start:desktop and should remain till you run npm run stop

Here is the screenshot of webpack window. I used Node v14.19.3 and npm 6.14.17 to test this. enter image description here

Hope this has give some next steps to troubleshoot.

Geeganage
  • 182
  • 1
  • 11
  • With that version of node/npm I get "Error: Cannot find module 'ajv/dist/core'" – user1283776 Aug 02 '22 at 22:18
  • Here are the dependencies I used. Make sure that you delete the package-lock.json before run `npm i` ```"dependencies": {"ajv": "^8.11.0", "ajv-dist": "^8.11.0", "core-js": "^3.9.1", "regenerator-runtime": "^0.13.7"}``` – Geeganage Aug 04 '22 at 05:01