- Notifications
You must be signed in to change notification settings - Fork1.9k
Closed
Description
🐛 Bug Report
Lib version: 3.9.0
Steps To Reproduce
constExcel=require("exceljs");constfs=require("fs");constinputFilePath="input.xlsx";constoutputFilePath="output.xlsx";(async()=>{constworkbook=newExcel.Workbook();constdata=awaitfs.promises.readFile(inputFilePath);awaitworkbook.xlsx.load(data.buffer);// Write.awaitfs.promises.writeFile(outputFilePath,awaitworkbook.xlsx.writeBuffer());})().catch((e)=>console.error(e));
Opening the output file with Excel results in the following:
<?version="1.0" encoding="UTF-8" standalone="yes"?><recoveryLogxmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> <logFileName> error043120_01.xml </logFileName> <summary> Errors were detected in file 'C:\Users\Rob\Documents\glen-tmp\output.xlsx' </summary> <removedPartssummary="Following is a list of removed parts:"> <removedPart> Removed Part: /xl/styles.xml part with XML error. (Styles) Load error. Line 2, column 6585. </removedPart> </removedParts> <repairedRecordssummary="Following is a list of repairs:"> <repairedRecord> Repaired Records: Cell information from /xl/worksheets/sheet2.xml part </repairedRecord> <repairedRecord> Repaired Records: Column information from /xl/worksheets/sheet2.xml part </repairedRecord> <repairedRecord> Repaired Records: Conditional formatting from /xl/worksheets/sheet2.xml part </repairedRecord> </repairedRecords></recoveryLog>
Just opening and saving the file causes the file size to go from 33 KB to 14 KB. 😮
If I clear the conditional formatting in the input file, then I don't see the errors (although the file size still drops dramatically, which is a bit worrying).
The expected behaviour:
No errors when opening the file in Excel, and possibly more similar file size of input and output files.
Possible solution (optional, but very helpful):
n/a
Edit: Here's a smaller reproduction:
Metadata
Metadata
Assignees
Labels
No labels