OfficeDev / vscode-debugger-extension-for-office-addins

VS Code extension to allow for debugging Office Add-ins in VS Code
18 stars 7 forks source link

How to open an existing Excel file in debugger #26

Open wz5899 opened 3 years ago

wz5899 commented 3 years ago

Can I debug in an existing Excel file? I know that Visual Studio can but can't figure out how to do it in Visual Studio Code.

I use the default configuration "Excel Desktop (Edge Chromium)" in launch.json. Every 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.