CORS call to REST webservice from Excel add-in fails

Category: developing apps for office 2013


Data Coffee on Thu, 28 Jan 2016 13:29:16

In an Excel add-in (based on office.js instead of VSTO), I had the following code that makes a RESTful web service call.

            $.getJSON("", function (data) {

When running on a standalone .html file, it worked fine and CORS just works.  However, it fails when running inside Excel add-in.  The call back "function (data)" is never called.  From fiddler, there is no trace of HTTP request to at all.

From reading office.js documents, CORS should just work, but it is not working for me.  Could you let me know what I missed?  Thanks!


Fei Xue on Fri, 29 Jan 2016 07:30:44


Any locally stored HTML file to access all other files on the disk, or communicate with any site on the Internet. It means, there is same-origin policy limitations for the file on the disk.

To address same-origin policy limitations in Office Add-ins, you can refer to the link below:
Addressing same-origin policy limitations in Office Add-ins

Regards & Fei

G00golplex on Tue, 22 May 2018 06:48:47


Concerning the link you have posted, there is no information at all how to simply do a web request which pulls data from a website. Like Data coffee said, it does not do anything. Didn't you Geniuses at Microsoft think of a possibility that a user has to pull data from a web service somehow? The funny thing is that if you go to Excel->Data->from web and use the interface you get your web request result but if you try to do this with a XMLhttpRequest you just get zilch! So is there no possiblity that the Excel JS API communicates with the built-in function of excel so i could finally get my data from a web service?

Many Thanks

Lif' on Mon, 16 Nov 2020 22:32:40


I'm facing the same issue. Rather annoying.

Have you found a solution?