David
David

Reputation: 1293

Excel found unreadable content in <filename>

I have an excel file that contains about 1000 rows. 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.

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. It can be fine for a while and then suddenly happen.

This is happening on Windows 7, Office 2010

Upvotes: 0

Views: 3601

Answers (2)

Maitreya
Maitreya

Reputation: 79

I had the same issue. The XML message was given to me was:

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

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

Upvotes: 0

Damien
Damien

Reputation: 1600

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

Upvotes: 1

Related Questions