3

I'm learning how to create addins for office. I'm using vscode and npm's "yo office". While I haven't progressed too far, I've done dozens of compiles and seeing the results in excel while I try/learn new things, and following the online modules for word and excel. Today, for the first time, when all I did was change the text in a header in taskpane.html, when I'm in excel and click on the taskpane button I get

enter image description here

I don't want to see this dialogue, particular when i never had it before.

I've been into launch.json, I tried setting useWebView to false. I've tried commenting out preLaunchTask so that I don't run in debug mode, or adding

"noDebug": true

I've tried disabling the debugger modules in vscode. None of these prevents this dialogue. I've scanned this forum and tried reading the API but they all appear to assume that use of webview debugging is desired. I've spent a bit of time, not as much, seeing if I could "attach VS code to the webview" but this started to go over my head and not something I ever wanted to do in the first place. I'm wondering if there was some update in the last week that added/enabled this "feature".

I appreciate any input on this novice question.

Update#1 I started a new addin project to see what happens. The dialogue appears when doing "npm start", something that did not happen in previous weeks.

Update#2 I did a complete reinstall of npm.js, office.js and vscode. didn't help.

Update#3 I further explored "attach the code" after reading the debugger module further. I added the url line. That did not solve the problem. Not sure what else is missing, particularly since these steps were not previously required.

{
      "name": "Excel Desktop (Edge Chromium)",
      "type": "edge",
      "request": "attach",
      "useWebView": "advanced",
      "port": 9229,
      "timeout": 600000,
      "url": "http://localhost/taskpane.html",
      "webRoot": "${workspaceRoot}",
      "preLaunchTask": "Debug: Excel Desktop",
      "postDebugTask": "Stop Debug"
    }
Lugh
  • 107
  • 9
  • Have you tried installing a VSCode extension mentioned in the dialog? – Eugene Astafiev Mar 16 '21 at 12:39
  • @Eugene Thank-you for your input. The module the dialogue refers to was already installed. I wondered whether it was causing the problem, so I just tried the opposite of your suggestion (uninstalling it, along with several other modules) and the problem still occurs. – Lugh Mar 17 '21 at 23:30
  • This dialog also started to appear to me out of nowhere! I've been looking in the Office JS updates about this but haven't found anything – hanuruh Apr 28 '21 at 15:17
  • i actually want to know how you get this to work. without it, i can interactively debug – mike01010 Apr 07 '23 at 23:32
  • This has to do with WebView Controls which can be uninstalled and make it go away, but they get forced re-installed – FreeSoftwareServers Apr 18 '23 at 18:10

1 Answers1

4

In npm/vscode, there is a file called package.json that contains scripts on how to run your program. "npm start" is just one of several scripts in package.json, and I presume coders can create their own. I saw that npm start called some module "office-addin-debugging" and i'm not really sure what this is, but a quick google on it exposed a '--no-debug' flag.

So in package.json:

"scripts": {
  ...
  "start": "office-addin-debugging start manifest.xml --no-debug",
  ...
}

Makes the dialogue go away. I'm going to wait a couple of days before closing the question to see if someone is able to provide a most robust answer about how to attach the code to webview, or why the dialogue suddenly appeared when in previous weeks it didn't. i.e. to resolve the dialogue while staying in debug mode.

Lugh
  • 107
  • 9
  • Thanks, for some reason my add-in kept restarting when I would start it with the `office-addin-debugging` command, when I would right-click->inspect it to bring up the Edge devtools. --no-debug solved that issue. Must be a recent change on Microsoft's part. Maybe a bug. – MDMoore313 May 07 '21 at 12:54