我遇到过同样的问题。给我的 XML 消息是:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error076520_01.xml</logFileName><summary>Errors were detected in file 'C:\Work\New Work\SOP New Tool.xlsm'</summary><removedRecords summary="Following is a list of removed records:"><removedRecord>Removed Records: Sorting from /xl/worksheets/sheet5.xml part</removedRecord></removedRecords></recoveryLog>
我现在可以在检查我的代码后修复它。
在该excel的sheet5中的排序功能中,我之前写过如下:
L = Worksheets("Early Response to Check").UsedRange.Rows.Count
With Worksheets("Early Response to Check").Sort
.SortFields.Add Key:=Range("P1"), Order:=xlAscending
.SortFields.Add Key:=Range("AX1"), Order:=xlAscending
.SetRange Range("A1:AZ" & L)
.Header = xlNo
.Apply
End With
这是它无法阅读的部分,并将其视为不可读的内容。
我需要将其更改为如下:
L = Worksheets("Early Response to Check").UsedRange.Rows.Count
With Worksheets("Early Response to Check").Sort
.SortFields.Add Key1:=Range("P1"), Order1:=xlAscending
.SortFields.Add Key2:=Range("AX1"), Order2:=xlAscending
.SetRange Range("A1:AZ" & L)
.Header = xlNo
.Apply
End With
瞧……错误消失了。
希望这也有助于其他人纠正此类错误。
谢谢,弥勒佛