npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

microsoft-office-add-in-debugger

v0.0.3

Published

Debug your Desktop Office Taskpane Add-ins in VS Code.

Downloads

2

Readme

Microsoft Office Add-in Debugger for Visual Studio Code

The "Microsoft Office Add-in Debugger" Extension for Visual Studio Code allows you to use F5 to debug your Office Add-in against the Edge runtime.

This debugging mode is dynamic, allowing you to set breakpoints while code is running. You can see changes in your code immediately while the debugger is attached, all without losing your debugging session. Your code changes also persist, so you can see the results of multiple changes to your code. The following image shows this extension in action.

Microsoft Office Add-in Debugger Extension debugging Excel Add-in code

Prerequisites

These instructions assume you have experience using the command line, understand basic JavaScript, and have created an Office add-in project before using the Yo OfficeDev/ generator-office).

Install and use

  1. If you do not already have a project to work with, create a new project with the latest version of Yo Office. If you already have a project you would like to use, there is no need to create a new one.

  2. Open a command prompt as administrator Command prompt options, including "run as administrator" in Windows 10

To open Visual Studio Code as an administrator, select the run as administrator option when opening Visual Studio Code after searching for it in Windows.

  1. Navigate to your project directory.

  2. Run the following command to open your project in Visual Studio Code as an administrator

    code .

    Once Visual Studio Code is open, navigate manually to the project folder.

    To open Visual Studio Code as an administrator, select the run as administrator option when opening Visual Studio Code after searching for it in Windows.

  3. Within VS Code, select CTRL + SHIFT + X to open the Extensions bar. Search for the "Office Addin Debugger" extension and install it.

  4. In the .vscode folder of your project, you will find a launch.json file. At the end of the file, add the following code to the configurations section of the file.

	    {
	    "type": "office-addin",
	    "request": "attach",
	    "name": "Attach to Office Add-ins",
	    "port": 9222,
	    "trace": "verbose",
	    "url": "https://localhost:3000/taskpane.html?_host_Info=HOST$Win32$16.01$en-US$$$$0",
	    "webRoot": "${workspaceFolder}",
	    "timeout": 45000
	    }
  1. In the section of JSON you just copied, find the "url" section. In this URL, you will need to replace the uppercase HOST text with the host application for your Office add-in. For example, if your Office add-in is for Excel, your URL value would be "https://localhost:3000/taskpane.html?_host_Info=Excel$Win32$16.01$en-US$$$$0".

  2. Open the command prompt and ensure you are at the root folder of your project. Run the command npm start to start the dev server. When your add-in loads in the Office host application, open the task pane.

  3. Return to Visual Studio Code and choose View > Debug or enter CTRL + SHIFT + D to switch to debug view.

  4. From the Debug options, choose Attach to Office Add-ins. Select F5 or choose Debug -> Start Debugging from the menu to begin debugging.

  5. Set a breakpoint in your project's task pane file. You can set breakpoints in VS Code by hovering next to a line of code and selecting the red circle which appears.

A red circle appears on a line of code in VS Code

  1. Run your add-in. You will see that breakpoints have been hit and you can inspect local variables.

Questions and comments

We'd love to get your feedback about this sample! You can send your feedback to us in the Issues section of this repository.

Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Copyright

Copyright (c) 2020 Microsoft Corporation. All rights reserved.