New Excel Add-In Script Lab Launched
19 April 2017
Microsoft said they would do it and now they have kept their promise with the release of Script Lab, an add-in for Excel (and other applications) described as a "Microsoft Garage" project (isn't that a type of '80's music?).
Script Lab is a tool for anyone who wants to learn about writing add-ins for Excel, Word or PowerPoint. The focus is the Office JavaScript API, but Microsoft also mentions that you can "...code snippets that can include... HTML, CSS, and references to libraries and data on the web..." as well.
Microsoft are keen to push the JavaScript API, as they see it as the technology needed for building Office add-ins that run across platforms. Whether you’re an experienced Office developer and you want to quickly prototype a feature or you’ve never tried writing code for Office and you just want to play with a sample and tweak it to learn more, this provides a "starter playground".
Script Lab has three main features:
- Code in a pane beside your spreadsheet. IntelliSense shows suggestions while you type so you can easily discover and use the Office JavaScript objects and methods. If you don’t want to start from scratch there are plenty of samples preinstalled with Script Lab. Your snippets can use any TypeScript features like async / await and convenient tools like arrow functions and template strings. Script Lab uses the Monaco editor, the same tech that powers VS Code, so it’s familiar to many
- Run the code in another pane beside the editor. Execution can include logic, API calls to Office, UI in the pane, and even output to a console. Every time you make a code change you can refresh the editor and run the new version in seconds
- Share your snippets through GitHub. If you create a snippet you’d like to share, you can use Script Lab to save it then send the link to someone else to try it and tweak it on their computer. The Import feature lets you load other people’s snippets.
You can install Script Lab right now for free from the Office Store. It works for Excel, Word, and PowerPoint on Office 2013 and later, Office Online and Office for Mac.
The source code is open to the community at https://github.com/OfficeDev/script-lab.