title | description | ms.date | ms.localizationpriority |
---|---|---|---|
Debug Office Add-ins on a Mac |
Learn how to use a Mac to debug Office Add-ins. |
07/09/2024 |
medium |
Because add-ins are developed using HTML and JavaScript, they are designed to work across platforms, but there might be subtle differences in how different browsers render the HTML. This article describes how to debug add-ins running on a Mac.
Important
Debugging add-ins with Office on Mac is only possible if Office is installed on the Mac from Office.com, not the Apple App Store.
If you have add-in that shows UI in a task pane or in a content add-in, you can debug an Office Add-in using Safari Web Inspector.
To be able to debug Office Add-ins on Mac, you must have Mac OS High Sierra AND Mac Office Version 16.9.1 (Build 18012504) or later. If you don't have an Office on Mac build, you might qualify for a Microsoft 365 E5 developer subscription through the Microsoft 365 Developer Program; for details, see the FAQ. Alternatively, you can sign up for a 1-month free trial or purchase a Microsoft 365 plan.
To start, open a terminal and set the OfficeWebAddinDeveloperExtras
property for the relevant Office application as follows:
-
defaults write com.microsoft.Word OfficeWebAddinDeveloperExtras -bool true
-
defaults write com.microsoft.Excel OfficeWebAddinDeveloperExtras -bool true
-
defaults write com.microsoft.Powerpoint OfficeWebAddinDeveloperExtras -bool true
-
defaults write com.microsoft.Outlook OfficeWebAddinDeveloperExtras -bool true
[!IMPORTANT] Mac App Store builds of Office don't support the
OfficeWebAddinDeveloperExtras
flag.
Then, open the Office application and sideload your add-in. Right-click (or select and hold) the add-in and you should see an Inspect Element option in the context menu. Select that option and it will pop the Inspector, where you can set breakpoints and debug your add-in.
Note
-
If you're debugging an event-based or spam-reporting add-in in Outlook on Mac, follow the steps in Debug your event-based or spam-reporting Outlook add-in after configuring the
OfficeWebAddinDeveloperExtras
property. -
If you're trying to use the inspector and the dialog flickers, update Office to the latest version. If that doesn't resolve the flickering, try the following workaround.
- Reduce the size of the dialog.
- Choose Inspect Element, which opens in a new window.
- Resize the dialog to its original size.
- Use the inspector as required.
[!includeadditional cache folders on Mac]