我正在尝试使用openpyxl更改启用宏的excel 2013文件中的1个单元格。这应该是一个相对容易的任务,我有以下代码,它可以工作,但由于某些原因,当我以后尝试打开修改后的excel文件时,我从excel得到了错误消息。在
我们发现“工作簿”中的某些内容有问题是否要恢复在
如果我恢复文件,它会从文件中删除大量内容,但我仍然可以看到我要修改的唯一单元格具有正确的数据。在
打开错误日志时,我收到以下消息:
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<logFileName>error086600_01.xml</logFileName>
<summary>Errors were detected in file 'C:\Files\2018 Workflow\Stress Due Date (NA) --- TR9999999 Pckg#9 - Emergency Equipment - 9 - 9 - 9\Panel Analysis --- 9 Version A.xlsm'</summary>
-<repairedParts summary="Following is a list of repairs:">
<repairedPart xml:space="preserve">Repaired Part: /xl/worksheets/sheet1.xml part. </repairedPart>
</repairedParts>
</recoveryLog>
下面是我的python代码,我已经看过了文档,看起来它应该可以工作,但是为什么它会损坏我的文件?在
^{pr2}$
首先,尝试在安全模式下打开Excel文件。如果它将打开,那么您可以使用COM加载项。尝试删除它们,然后打开文件。在
相关问题 更多 >
编程相关推荐