gpt4 book ai didi

java - Excel 能够通过修复或删除不可读的内容来打开文件

转载 作者:行者123 更新时间:2023-11-30 08:45:48 25 4
gpt4 key购买 nike

我正在生成带有动态数据的 excel 文件,在某些单元格中有公式,当我打开生成的 excel 文件时,我从 ms excel 收到一条弹出消息:

Excel was able to open the file by repairing or removing the unreadable content.

Removed Records: Shared formula from /xl/worksheets/sheet1.xml part Removed Records: Formula from /xl/calcChain.xml part (Calculation properties)

ms excel 生成的日志。

<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<logFileName>error120920_01.xml</logFileName>
<summary>Errors were detected in file 'C:\fileName.xlsx'</summary>
-<removedRecords summary="Following is a list of removed records:">
<removedRecord>Removed Records: Shared formula from /xl/worksheets/sheet1.xml part</removedRecord>
<removedRecord>Removed Records: Formula from /xl/calcChain.xml part (Calculation properties)</removedRecord>
</removedRecords>
</recoveryLog>

我无法找到此问题的确切根本原因。我想找出造成此问题的单元格。库版本:apache poi 3.11

最佳答案

在 excel 模板文件中,在一个单元格上设置了 excel 公式,我试图设置 XSSFCell.CELL_TYPE_NUMERIC 并使用代码为其分配数值。这是导致打开 ms excel 文件时出现问题的原因。

关于java - Excel 能够通过修复或删除不可读的内容来打开文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33117687/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com