OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
641 stars 92 forks source link

Office.context.document.getFileAsync return corrupted file #4420

Closed dgpham112 closed 2 weeks ago

dgpham112 commented 2 weeks ago

I have an Excel file with 30 sheets. Im try to use Office.context.document.getFileAsync and convert the data to a blob object, then download as an Excel file. When open the Excel file, it show the message the file was corrupted and offer an option to recover it and remove some data.

The error log as following: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

Repair Result to myfile0.xml Errors were detected in file '/Users/dgpham/Downloads/myfile.xlsx' Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded. Removed Part: /xl/pivotCache/pivotCacheDefinition6.xml part with XML error. (PivotTable cache) Xml parsing error Line 2, column 2761. Removed Feature: PivotTable report from /xl/pivotTables/pivotTable23.xml part (PivotTable view) Removed Feature: PivotTable report from /xl/worksheets/sheet27.xml part Repaired Records: Cell information from /xl/worksheets/sheet14.xml part Repaired Records: Cell information from /xl/worksheets/sheet15.xml part Repaired Records: Cell information from /xl/worksheets/sheet16.xml part