This blog is the first of a series highlighting the shared runtime feature of the Office Add-ins platform.
The Office Add-ins platform allows developers to build solutions that integrate with and extend the Office UI surfaces. In Excel, this includes creating task panes, adding ribbon buttons, and building custom functions. Previously, add-in code for each of these elements ran in separate runtimes and required some effort to pass information between them.
The shared runtime makes it easier to build Office Add-ins within a single context by enabling all elements to run in one common browser-based runtime. This is an important paradigm for add-ins that want to build a cohesive experience using common state and data.
Additionally, the shared runtime also enables new capabilities many developers have requested:
- Run code when a document associated with your add-in is opened
- Hide or show your task pane without losing state
- Listen for and trigger events even when the task pane is not visible
- Allow custom functions to work with existing cookie-based authentication systems
Get started with the shared runtime
Not every Office Add-in needs to use the shared runtime, especially if you only integrate with one part of the Office UI. You can easily convert your add-in to a shared runtime later once your add-in’s capability grows with a simple manifest change.
For example, here are a few ideas to help you get started:
- One-click authentication—Create a ribbon button that logs the user into your service, even for custom functions.
- Refresh document on open—If your add-in integrates with a backend database, check that data in the spreadsheet is synced with the server.
- Enable and disable add-in commands—Depending on what cell is selected, have the relevant ribbon buttons become clickable
- Maximize usage of screen real estate—Show more of the Excel grid when the task pane is not relevant to the current task. You can show or hide the task pane without losing any session data your add-in is working with.
Jeremy is a Senior Program Manager on the Microsoft 365 Developer Platform team
Next in this series, we’ll share our top tips for using the shared runtime successfully.