Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

169
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda