Recently, I was asked what is needed in order to create the most basic add-in you can. The least amount of files, work and effort. Technically, you only need two files:
- An XML Manifest file that defines the add-in.
To demonstrate this, I created a simple Excel add-in. Here is the code for the bare minimum manifest XML:
<?xml version="1.0" encoding="UTF-8"?> <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp"> <Id>5226365f-62d0-435f-a4af-cc6a7bd753b2</Id> <Version>126.96.36.199</Version> <ProviderName>TheOfficeContext.com</ProviderName> <DefaultLocale>en-US</DefaultLocale> <DisplayName DefaultValue="BasicAddin" /> <Description DefaultValue="This is a basic addin."/> <IconUrl DefaultValue="" /> <Hosts> <Host Name="Workbook" /> </Hosts> <DefaultSettings> <SourceLocation DefaultValue="https://basicaddin.azurewebsites.net/home.html" /> </DefaultSettings> <Permissions>ReadWriteDocument</Permissions> </OfficeApp>
Here is the HTML file that is quite basic, I am not even using the Microsoft Fabric for the controls. This is a simple HTML page, period:
What this add-in does is very simple. It opens the task pane with a single button. Enter some text in a cell in Excel, select that cell, and then click the button. It gets the text and displays it in a popup at the bottom of the pane. I have published this add-in manifest here:
You can run it by using these steps:
- Open Excel Online. I first log into https://outlook.office365.com. Then I click on the menu button in the upper left and select Excel.
- I select to create a “New blank workbook.”
- On the Insert tab, I click Add-ins.
- In the upper right, I select “Upload My Add-in”
- I click Browse and in the Filename box, I put https://basicaddin.azurewebsites.net/basicaddin.xml and then click Open. This will download the add-in to the cache on your system and you will get a file name like “basicaddin.xml.”
- Click Upload.
- The add-in will load from my Azure site and you will see the button demonstrated above.
Now, to go ahead and answer a question I know are coming. How did I upload this Azure without Visual Studio publishing tools:
- I went to my Azure Protal (portal.azure.com).
- I clicked the +New button on the left side.
- I selected Web + Mobile, then Web App
- I filled in the required information: Name and resource group and clicked Create.
- After it was done, I followed these steps to get to the site via FTP: https://blogs.msdn.microsoft.com/kaushal/2014/08/01/microsoft-azure-web-site-connect-to-your-site-via-ftp-and-uploaddownload-files/
- I uploaded ONLY the HTML file.
- I got the path to the location from the Azure portal:
- Next, I updated the XML manifest to point to https://basicaddin.azurewebsites.net/home.html
- Then I used the steps above to load it into Excel Online.
This is fairly simple from a web developer perspective. Now, if you are not a web developer (but a traditional Office developer), you are probably still on the fence on how/why you would want to go through all of this. Again, the primary thing I am demonstrating here is how you can build an add-in with as few files as possible. But, I want to reiterate how these new add-ins are truly cross-platform. Follow these steps on your iPad and you will know what I mean. It is incredible and this work really is not that difficult to perform. It might just be a tad time consuming in the beginning as you are getting used to the new interfaces.
If you have questions, please feel free to reach out to me.