简体   繁体   English

Excel 发现无法读取的内容<filename>

[英]Excel found unreadable content in <filename>

I have an excel file that contains about 1000 rows.我有一个包含大约 1000 行的 excel 文件。 Each row has an image, kind of like a thumbnail size in one of the columns.每行都有一个图像,有点像其中一列中的缩略图大小。 The cell that the image overlaps has a comment which actually contains a bigger version of the same image.图像重叠的单元格有一个注释,它实际上包含同一图像的更大版本。

Every now and then when opening the file I get时不时地打开文件时我得到

Excel found unreadable content in <filename>.  Do you want to recover
the contents of the file.  If I say No it closes.

If I say yes it repairs and removes some parts with the following log:如果我说是,它会修复并删除一些带有以下日志的部件:

Removed Part: /xl/drawings/vmlDrawing1.vml part.  (Drawing shape)
Removed Part: /xl/drawings/vmlDrawing2.vml part.  (Drawing shape)

What then happens is the comments (that contain the bigger version of the image) are all gone on every row.然后发生的是评论(包含图像的更大版本)在每一行都消失了。

The file originally contains a macro that runs and once its done I save the file as xlsx which strips the macro out which is fine.该文件最初包含一个运行的宏,一旦完成,我将文件另存为 xlsx,它可以将宏去掉,这很好。

There is no concrete pattern to this behaviour, its not like it happens the first time I re-open it after saving as xlsx or anything.这种行为没有具体的模式,它不像我第一次在保存为 xlsx 或任何东西后重新打开它时发生的那样。 It can be fine for a while and then suddenly happen.它可能会好一会儿,然后突然发生。

This is happening on Windows 7, Office 2010这是在 Windows 7、Office 2010 上发生的

I had the same issue and was able to fix it.我遇到了同样的问题并且能够修复它。 The issue is due to cache in memory.问题是由于内存中的缓存。 This is the code that resolved the problem for me.这是为我解决问题的代码。

Public Sub PT_cache_clear() Dim pc As PivotCache Dim ws As Worksheet
With ActiveWorkbook For Each pc In .PivotCaches pc.MissingItemsLimit = xlMissingItemsNone Next pc End With
End Sub

I had the same issue.我遇到过同样的问题。 The XML message was given to me was:给我的 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>

I am now able to fixed it after checking my code.我现在可以在检查我的代码后修复它。

In the sort function in sheet5 of that excel i previously wrote as below:在那个excel的sheet5中的sort函数中,我之前写过如下:

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

This is the part it was not able to read and considering it as unreadable content.这是它无法阅读并将其视为不可读内容的部分。

I need to change it to as below:我需要将其更改为如下所示:

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

And Voila... the error is gone.瞧……错误消失了。

Hope this helps someone else as well to rectify such error.希望这也有助于其他人纠正此类错误。

Thanks, Maitreya谢谢,弥勒

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM