0

I am following the tutorial on https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/excel-quickstart-jquery?tabs=visualstudio

When I run the add-in from VS2022 in debug mode (F5), the add-in does not load (error "This add-in could not be started. Close this dialog to ignore the problem or click "Restart" to try again") enter image description here

When I run the add-in from VS2022 without debugging (CTRL-F5), the add-in works fine...

In both cases, the page on https://localhost:xxxx/Home.html is working fine, it's only Excel that refuses to load the plugin while using VS Debug Mode.

I have another computer on which it both ways are working fine. Both computers have a similar software setup.

Where should I start looking for the cause of this?

Thanks

intrixius
  • 1,096
  • 2
  • 11
  • 25

1 Answers1

1

OK. I got this to run on my machine, it took a bit of time to figure out but steps are documented here - https://learn.microsoft.com/en-us/office/dev/add-ins/develop/debug-office-add-ins-in-visual-studio

Here is a hint - You write the plugin code in JavaScript, it gets loaded in legacy WebView (EdgeHTML) control in Excel IDE. How would you debug the code?

Here is what I tried and it worked -

  1. Launch your project from VS IDE, this should launch excel window. enter image description here

  2. Click on 'Home'-'Show Taskpane' button. If it is not visible, the Taskpane window should appear on the right side. This is where add in is loaded. enter image description here

  3. This is the WebView control that loads your HTML UI + associated javascript code. enter image description here

  4. Right click on it, click on the 'Inspect' menu. This should launch the Developer Tools that you normally get when debugging web pages. enter image description here

  5. Put your break points in the JS code and hit the button. The debugger should break in associated JS code.

Amogh Sarpotdar
  • 544
  • 4
  • 15
  • So, basically, you are saying that the "run and debug" option in vs2022 should not be used, but instead you should use the developer tools in the browser? That kind of defeats the debug option in vs2022... Also, that means the MS documentation should be changed... – intrixius Jul 04 '22 at 18:01
  • No. Launch it in visual studio with standard debugging menu. The green triangle. It launches the plugin along with an instance of excel. I am amending the main answer, take a look at the new image. – Amogh Sarpotdar Jul 04 '22 at 18:40
  • I have added some more information, since it seems to be a computer specific issue... – intrixius Jul 06 '22 at 07:29
  • Interesting. I dont get the error message that you have recently updated. Just checking, have you seen this? https://learn.microsoft.com/en-us/office/dev/add-ins/testing/testing-and-troubleshooting – Amogh Sarpotdar Jul 06 '22 at 09:06