Questions tagged [scriptlab]

Script Lab is an interactive playground for Office Add-ins, letting you experiment with Office JavaScript API without ever leaving Excel, Word, PowerPoint, or Project. Tag questions with `script-lab` (and likely with `office-js` as well) if they are either about Script Lab, or have examples or answers that use Script Lab.

Experiment with the Office JavaScript API without ever leaving Excel, Word, or PowerPoint! Install Script Lab for free from https://aka.ms/getscriptlab, and then use it to:

  • Create and edit code snippets that can include JavaScript, HTML, CSS, and references to libraries and data on the web Run the snippets and instantly see the result in a task pane and in the Office document
  • Get started quickly with a selection of samples
  • Share and save your snippets with GitHub gists
  • Learn the JavaScript API with the help of IntelliSense while you edit
  • Try TypeScript: make use of lambda functions, template strings, or even the latest TypeScript 2.0+ features like async/await
  • Prototype an add-in you're planning to develop

There's no need to install any other software or configure your environment: as long as you have Office, you can get started in seconds. Script Lab is available as a free add-in from the Office Store.

Script Lab works in Excel, Word, PowerPoint, and Project (Office 2013 and later, Office Online, and Office for Mac).

The source code, issues list, suggestions, and support for Script Lab can all be found at https://github.com/OfficeDev/script-lab.

64 questions
6
votes
1 answer

Submit add-ins with custom functions (update?)

I asked a question regarding submitting add-ins with custom functions 6 months ago. The conclusion at the moment was an add-in that uses custom functions cannot currently be published to the Office Store or via Office 365 centralized deployment. But…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
4
votes
2 answers

Office Scripts VS Script Lab

I am confused about Office Scripts and Script Lab. Both can run javascript in Excel, but it seems the code can't be shared in them. For Office Scripts, some code like function main(workbook: ExcelScript.Workbook) { // Set fill color to FFC000 for…
Edward
  • 28,296
  • 11
  • 76
  • 121
4
votes
0 answers

Using Office UI Fabric React components in ScriptLab

In a simple Test Web App I was able to create a UI Fabric React output by using imports like this: import React from 'react'; import ReactDOM from 'react-dom'; import { DefaultButton } from 'office-ui-fabric-react'; and rendering in…
Maarten van Stam
  • 1,901
  • 1
  • 11
  • 16
4
votes
1 answer

`context.document.body.insertOoxml` breaks documents, crashes word

I know this is not a question, but I was sent here by Rick Kirkham from here, and apparently asking on SO is the way to file bugs for Microsoft products :-p When I use insertOoxml with the 'replace' parameter, Word will insert extra content at the…
Thiez
  • 177
  • 1
  • 9
4
votes
2 answers

Format entire column of Excel table as String

I'm working on an Excel add-in using the JavaScript APIs to build add-ins in Excel Office 365. For Excel tables, how can I format the entire column to have strings only by default. [ I need the numbers to appear as 012 instead of 12 in all the cells…
Deb
  • 349
  • 2
  • 7
  • 14
2
votes
2 answers

What is the process involved in registering custom functions at runtime?

I am creating an Excel add-in and one of the features that we'd like to give our users is to let them create custom functions that are registered and added at runtime. I understand how to create custom functions at design time by adding entries to…
2
votes
2 answers

Office.Settings not retrievable in Excel Online when created and set in Excel Desktop

According to the API docs, the Office.Settings objects are saved per add-in and per document. That is, they are available only to the add-in that created them, and only from the document in which they are saved. I'm a bit confused regarding the…
VivSter2.0
  • 23
  • 1
  • 5
2
votes
2 answers

How can i make local file I/O with Microsoft Office JavaScript API using Script Lab?

I am trying to read/write data from/to local files with Microsoft Office Javascript API using Script Lab to my Excel snippet. Still did not find any proper way to do it. Have tried this solution: function readTextFile(file) { var rawFile = new…
mbsagin
  • 21
  • 5
2
votes
1 answer

Can't share script using Script Lab

I'm playing with Script Lab in Excel 2016. This is great stuff! However, when trying to share a snippet in GitHub, after loggin in from the task pane, the Authorize button is disabled. Why is this happening? See the screenshot below.
user882670
2
votes
1 answer

Syntax error when using Office UI Fabric in a ScriptLab' JavaScript project

In a new ScriptLab's JavaScript project, I added the following library to get Office UI Fabric functionality: https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.2.0/js/fabric.min.js So I wrote this script (just pay attention to…
1
vote
0 answers

Excel Custom function returns #BUSY

I am using Script Lab for defining custom function in Excel. Even the most trivial function returns #BUSY result. This is test funcition that returns #BUSY error. /** @CustomFunction */ function add10(x: number): number { return x + 10; } I am…
1
vote
0 answers

Is it possible for a combobox in Script Lab to have a range as source in excel?