1
votes

I am developing an Office Excel Javascript addin using Microsoft Visual Studio 2015 Community Edition. I have installed Microsoft Excel 2016 for Windows. Now my addin needs to run certain methods which require Excel Api: Api Set 1.4. Now currently Visual Studio is using Api Set 1.1. What I want to know is how can I use the latest Api set which is 1.4 in Visual Studio so that I will get access to the latest methods.

This is what I have tried so far,

if(Office.context.requirements.isSetSupported("ExcelApi", 1.4){
//some code
}else {
console.log("Not supported");
}

which gives me "Not Supported".

I am referencing this office.js from the cdn:

script src="https://appsforoffice.microsoft.com/lib/1/hosted/Office.js" type="text/javascript"

Does anybody have any insights about this?

2

2 Answers

0
votes

Excel 2016 (installed with MSI) will not support Excel API 1.4 (See the note at the bottom of Add-in Availability.) You need the subscription (click-to-run) version of Excel that is in Office 365. Also, replace the "1" in your script link with "beta". See this page for details: Excel API Requirement Sets.

0
votes

To add to Ricky's answer:

  • As noted by Ricky, Office 2016 is different from the subscription-based Office 365, with only the latter getting updates to APIs. The Office host-application versioning and API versioning are both described in detail in the book "Building Office Add-ins using Office.js", available at https://leanpub.com/buildingofficeaddins/. (Full disclosure, I am the author of said book; but I do think you'll find plenty of very useful information therein, esp. about the APIs themselves).
  • The 1.4 APIs in particular are about a week or two away from being on the production CDN; so yes, right now you would need to use "beta", but the usual Office.js CDN URL will be good to use for 1.4 APIs in the near future.
  • Even if you are on the Office 365 subscription, it takes some time between the API team being "done" with a particular API set, and it being publicly available (generally about 1.5 months). So for 1.4 in particular, which was part of the January fork, looks like it's only rolling out publicly right now. If you're on an Office 365 enterprise subscription and are on the deferred channel (again, see more info in the book), you may be even further out. You'll know that your client supports it once isSetSupported("ExcelApi", 1.4) returns true.