Check if a JavaScript method or property is supported in an Excel version

396 views Asked by At

I code JavaScript add-ins in Mac, so I don't use Visual Studio very often (but I can launch Windows and run Visual Studio if it is really needed). I am quite confused how to check if a JavaScript method or property is supported in an Excel version, based on references on the web.

Taking Document.addHandlerAsync method for example, according the page, it has been added in 1.1, does this 1.1 mean ExcelApi 1.1? But according to this page, it belongs to Common API requirement sets and can be used in Excel 2013?

When I check Visual Studio, it does not give the version information:

enter image description here

There are several relevant pages: Office Add-in host and platform availability, Office common API requirement sets, Excel JavaScript API requirement sets, none of them alone is complete enough to answer if a method/property is supported in a certain Excel version.

Addtionally, what are in Excel JavaScript API 1.1?

enter image description here

1

There are 1 answers

0
Sudhi Ramamurthy On BEST ANSWER

Broadly, there are 2 flavors of the Office JS APIs.

  1. The "shared" APIs are not host specific and most of them work across Excel, Word, PowerPoint, etc. (not all and hence the need for methods and feature specific requirement set such as MatrixCoercion, TextBindings). If you are authoring add-ins that need to run cross-host and targets Office-2013 mainly, then this set API will be helpful. Another difference is in the style of these APIs - they have call-back based syntax as opposed to promise based execution that was introduced later. In the API specs pages, these APIs are available under "SHARED API" section on dev.office.com site. They have this entry titled "Added in 1.1". The 1.1 here refers to CDN version and this is not to be confused with the requirement sets such as Excel1.1.

  2. More modern and host specific APIs that are promise based. These API are grouped under requirement-sets such as Excel1.1, Excel1.2, Word1.3, etc. These APIs were introduced with Office-2016 and we are incrementally adding new APIs under newer requirement sets. You can find the exact requirement number in the API specs using the table (column titled "Req-set."). It links to "Excel JavaScript API requirement sets" page, which lists the features added in newer releases. The first release was under Excel1.1 and it had 100s of APIs and hence there is no separate table for 1.1 in the "Excel JavaScript API requirement sets" page.

The "shared API" docs definitely needs some fixes. We'll work on that fairly soon. Making the the requirement set name part of intellisence is a great idea that we've talked about as well. It may take longer to make that available as part of d.ts or VSDOCS.