Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
how to include a configuration xml file in an Office add-in

I have an office Excel add-in written in TypeScript and I need to include a configuration XML file where I could save some settings which should be preserved across all documents. I included the XML file in the task pane folder like this:

 Directory of C:\Users\user\add-in\src\taskpane

01/30/2022  06:40 PM    <DIR>          .
01/30/2022  06:40 PM    <DIR>          ..
01/29/2022  09:13 PM               259 settings.xml
01/28/2022  07:20 PM             3,639 taskpane.css
01/28/2022  04:31 PM             2,307 taskpane.html
01/30/2022  06:47 PM            24,187 taskpane.ts

I try to read the file using this code:

function readSettings() {
  try {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = readSettingsHandler;
    xhttp.open("GET", "settings.xml", true);
    xhttp.send();
  } catch (error) {
    console.error(error);
  }
}

function readSettingsHandler(event) {
  try {
    if (this.readyState == 4 && this.status == 0) {
      var content = this.responseText;
      console.log(content);
    }
  } catch (error) {
    console.error(error);
  }
}

I get 404 Not found error. As a test, I tried to specify the full path, like this:

    xhttp.open("GET", "C:\\Users\\user\\add-in\\src\\taskpane\\settings.xml", true);

Then the script sees the file, but I get a "blocked:other" error and the responseText property returns an empty string.

What is the correct way to include a settings file in an Office add-in project?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!