0

This article says a new simplified Office API is in "Preview" mode. Who gets to preview it? When will it come out of Preview (been almost a year)? Will it be available in Excel online? Is a special license required? I'm using the free Excel online.

If i create a script containing the following:

function main(workbook: ExcelScript.Workbook) { 
  // Your code goes here 
}

i just get an error "Cannot find namespace 'ExcelScript'." Can i enable this by adding something to the Libraries tab?

1
  • 2
    I think it's harsh voting this down, I spent a few days trying to understand what Microsoft were on about with JS & Office several months ago & it was not clear or easy to follow - I gave up. Glad you asked the question, it is a valid contribution in my view - as of course is the answer Commented Sep 5, 2021 at 16:08

3 Answers 3

3

This API is part of Office Scripts application, which is a scripting platform. The API is not available for add-ins, which still uses Office-js. My read is that you attempted to use this in Script-Lab, which again is an add-in playground.

Sign up to request clarification or add additional context in comments.

1 Comment

Doesn't answer the question "How to enable it".
3

The "new synchronous Excel Javascript API" is formally known as "Office Scripts", or "Office Scripts in Excel on the web".

This TypeScript-based programming interface is only available to paid licensed business or educational accounts, or through a free Developer account.

With any of these types of accounts, the Office Scripts IDE can be accessed through the "Automate" tab in Excel on the web.

In new Developer accounts, it's enabled by default. In paid licensed accounts, it may need to be enabled at https://admin.microsoft.com > left-pane 'Show All' > Settings > Settings (or Org Settings) > Office Scripts.

It's not available to standard free (non-developer) Office 365 accounts. Only vanilla Javascript is available, through the Script Lab Add-in. Office Scripts entered into the Script Lab IDE will raise errors, as described in the OP.

1 Comment

Answers the question "How to enable it".
2

For details see Office Script Documentation. In particular, it is available on the Automate tab of Excel on the web. See here: Office Scripts for Excel on the web.

2 Comments

Apparently, requires paid OneDrive Business, plus paid a commercial or educational Microsoft 365 license. Ouch. Is it available free in any way, such as with a free Developer account?
Doesn't answer the question "How to enable it".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.