Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[BUG] Errors when opening file in Excel after saving a file with conditional formatting #1305

Closed
@glen-84

Description

@glen-84

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

input.xlsx
output.xlsx

Opening the output file with Excel results in the following:

image

<?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:

simple3-input.xlsx
simple3-output.xlsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp