4

I am developing and Office add in using AngularJS and the adal-angular template provided by Microsoft through the Yeoman Office generator.

After everything was configured correctly I published my manifest.xml to a file share. I then told Excel to trust this file share as an app catalog. I can run the add in just fine, using Excel.

Now, though the add in runs fine, I have no indication of errors or logging messages. If an error occurs, I can't see what actually happen, I can only see the .html file I'm currently loading. This might look like this:

enter image description here

It can't be true that I haven o way of logging, debugging or at least see errors when developing my add in.

As I'm using Gulp to serve the application, I have a command prompt running. It looks like this:

enter image description here

Shouldn't I be able to log in this window, and see errors whenever they occur?

halfer
  • 19,824
  • 17
  • 99
  • 186
Detilium
  • 2,868
  • 9
  • 30
  • 65

2 Answers2

3

If you want to debug in the Windows desktop versions of Excel/Word/PowerPoint, you can use the IE Developer Tools, which have a good debugger, console, DOM-explorer, etc:

  1. Run the add-in
  2. Go to System32/F12 on your machine
  3. Run F12Chooser.exe
  4. Click Refresh and wait a couple seconds
  5. Choose the process you want to debug from your add-in

The main advantage here is that you can use the native Office clients with this debugging method. For testing in Office Online, Mr.P's answer will work well for you. Note also that the F12 Chooser is available starting in Windows 10.

-Michael Saunders, PM for Office add-ins

Michael Saunders
  • 2,662
  • 1
  • 12
  • 21
  • This works pretty well, it's just annoying that you actually need to restart the F12Chooser.exe every time you restart the app. – Detilium Aug 15 '16 at 06:12
  • Hi Michael. When you get a moment, would you [read this discussion](https://meta.stackoverflow.com/questions/363528/should-editors-excise-signatures-in-answers-even-if-they-contain-useful-organisa) about using signatures in posts? I think the community consensus is that you don't need to add this normally, and only need to declare your company affiliation if there is a conflict-of-interest scenario (e.g. recommending purchases). On the occasions you feel it's necessary, you can say "I am the PM for Office Add-Ins", since your user card includes your name already. – halfer Mar 30 '18 at 11:01
1

I've dealt with the pain of Office add-ins before. It's not a fun place to be. However, I tested out most of the work I was doing in two different ways throughout development:

1) I opened the inspector in Chrome and changed it to mobile view and then set the size to the average add-in size. I know it can change in size, but just to give a general look.

2) I used Office online to actually run my manifest.xml file and then just opened the browser console to see my logging. This was the best way for me to see how things were working. More details of that here.

Hope that helps.

Mr.P
  • 1,390
  • 13
  • 35