In this article, I will show you how you can load an Office 365 add-in from a network share for testing or live deployment.
If you are a developer who builds add-ins for Office 365, then you need to test those before deployment; and if you are developing for enterprise users then they need to access your add-ins after roll-out.
A network share (sharing your add-in from a network drive) is the easiest possible way for both of that. Read this interesting article where I show how to test and deploy Office 365 add-ins from a network share.
- Either of:
- Visual Studio 2015 or
- Visual Studio 2017 (with Office Developer Tools)
- Visual Studio Code (with Yeoman Office generator a.k.a. Yo Office!)
- Office 365 add-in manifest (XML file)
- A web server running your Office 365 add-in (web component)
If you have already created an Office 365 add-in, then you can skip this “Getting Started” section and jump directly to the next “Publish, Test & Deploy” section.
Create an Office 365 add-in using tools I have mentioned in prerequisites. Read below section for how to do that:
- Visual Studio 2017:
- Visual Studio 2015:
- Open VS 2015 then click “New Project” and select “App for Office” under “Office/SharePoint” templates:
Give proper project name and click “Ok” button in above dialog.
Select “Task pane” from the next dialog:
Click next and select Excel from the next popup:
Click “Finish” and you are done!
- Visual Studio Code with Yeoman Office Project Generator
- Follow the instructions on Office Developer GitHub page here.
Publish, Test & Deploy
You can publish your Office 365 add-in web project on either IIS Server or on Azure.
For deploying web app on Azure, read another author’s article here.
For deploying web app on IIS Server, follow instructions here.
Or simply you can test it by pressing F5 from Visual Studio and let it run till you finish testing.
For showing you further instructions in this article, I have deployed my add-in web project on Azure.
All you need now is the URL on which your add-in web project is deployed. You need to configure it in the add-in manifest xml file.
Go to the solution explorer in VS 2017 and open the file location of the manifest file:
All you need is a copy of this manifest XML file. Copy it and paste it on any network share available for testing. I have shared it under “ExcelWebAddIn2Manifest” network share for my testing.
Open the manifest XML file in VS 2017 or any XML editor or simply Notepad, find “SourceLocation”:
You need to change the “DefaultValue” to the URL on which you deployed your add-in web app.
I have changed its value to point to my deployment URL:
That’s the only change you need to make. Now let’s add this manifest file in Excel to see our add-in working.
Open Excel, create a new blank workbook. Go to File -> Options -> Trust Center -> Trust Center Settings:
Go to “Trusted Add-in Catalogs”, enter network share path in “Catalog URL”, then click “Add catalog”:
Select “Show in Menu” checkbox, then click “OK”:
Once you click OK button, you will be shown following message:
Click OK and close all dialogs, then close Excel and start it again. Create a new workbook.
Go to Insert ribbon then click “Store”:
Click “Shared Folder” link, and you will see your add-in. If not, then try clicking refresh and see:
Select the add-in and click add button.
Excel will load add-in and show you message that it has loaded:
Click on “Show Taskpane” and your add-in will be loaded:
Congratulations! Your Office 365 add-in is now ready to use. You can use the above steps for testing your add-in or while deploying in live environment too.
That’s it for this article. Happy learning!