2

I am trying to read the current opened document (where the add-in will be ran) to upload it to a web service. But when I tried retrieving the file, an internal error occurs. OS: Windows 10 Add-in Host: Excel Platform: Scriptlab (will migrate to the visual studio when done) Hope someone can help me. Here's my code snippet:

Office.context.document.getFileAsync(Office.FileType.Compressed, { sliceSize: 10240 },
  function (result) {
    console.log(result);
    if (result.status == Office.AsyncResultStatus.Succeeded) {
      var myFile = result.value;

      myFile.closeAsync();
    }
    else {
      console.log("Error:", result);
    }
  }
);
  • what's the error message? I would like to have a local repro, could you please share me the gist via scriptlab? https://learn.microsoft.com/en-us/office/dev/add-ins/overview/explore-with-script-lab#save-and-share-snippets – Raymond Lu Sep 02 '20 at 01:57

0 Answers0