I try to debug an Excel Javascript Add-in using Office add-in debugger in Visual Studio Code. I want to configure the debugger to open an existing Excel file.
I use the default configuration "Excel Desktop (Edge Chromium)" in launch.json. But each time I press F5, it creates a new Excel file. The file name is the GUID in the Id tag in manifest.xml, such as a32c06d3-4bbb-4158-8b61-e0349f58019c.xlsx.
I saw this configuration runs a preLaunchTask "Debug: Excel Desktop". This task is specified in task.json:
"label": "Debug: Excel Desktop",
"type": "npm",
"script": "start:desktop -- --app excel,
"presentation": {
"clear": true,
"panel": "dedicated",
},
"problemMatcher": []
It is the "npm start:desktop -- --app excel" that creates the new Excel file.
I tried
npm start:desktop -- --app excel 'directory\filename'
But npm still creates the GUID named excel file instead of opening the file specified. I know in Visual Studio, you can launch the debugger and attach to an existing Excel file (explained in this link: Debug Excel add-in written by JavaScript API on an existing workbook). Can Visual Studio Code do the same?