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);
}
}
);