Excel Add in - Rest API

0

I am trying to do an API call to my own server using an Add In on Excel.

This is the code I am using :

var xhr = new XMLHttpRequest();
xhr.open('POST', 'myurl');
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Access-Control-Allow-Origin", "*");
xhr.withCredentials = true
xhr.send(JSON.stringify({
        MYJSON
    }))

I keep receiving the error :

SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Refused access.

Do you know what I am supposed to do ? I suspect it is a problem with CORS however I am using services from AWS and I enabled CORS on API gateway.

It has been several days that I am searching, I have added my domain in the XML of the application but it does not work.

Do you know what I am supposed to do ? Thanks a lot!!

javascript
excel
add
add-in
asked on Stack Overflow Jul 14, 2018 by Mike • edited Jul 14, 2018 by Mike

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0