Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

174
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda