xlsx history file Excel finds a problem with the embedded images; will only open if it edits/removes image.

 

I've been trying to open up xlsx histories that I have generated in Microsoft Excel 2021 (professional plus).   Old ones and also ones I just generated yesterday with 5.0 b4040.

We found a problem with some content in ‘ReportHistory.xIsx‘. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes.


You cannot continue to open the file unless you say Yes.   And when you do, it removes the drawings!!!  equity drawing. And you get this error message:


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

 

Removed Part /xl/drawings/drawing1.xml part. (Drawing shape)



Click to view log file listing repairs.

The error file is an xml file that says:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error358840_02.xml</logFileName><summary>Errors were detected in file 'C:\Users\Administrator\Documents\ReportHistory.xlsx'</summary><removedParts><removedPart>Removed Part: /xl/drawings/drawing1.xml part.  (Drawing shape)</removedPart></removedParts></recoveryLog>


Again, basically all the history text data is there.  But the photo is removed.


I checked on an older laptop with identical version of MS Office 2021 and I opened the file and don't get this error.  In fact, I never got this error until today.   I also tried using OpenOffice Calc on the same laptop as the problem Excel, and no errors.


Both computer have the same Windows 10 OS LTSC 2021.   And MS Office 2021.  But the problem Excel's laptop is AMD processor and RADEON Graphics vs working Excel laptop Intel i5 integrated + Nvidia products.  Although I don't see that making a difference.   Antivirus is disabled on both.

When I did a google search, I find out that other people have a similar problem.  They are told to copy to a new xlsx file and save the data.   But this does not solve the problem of why for some people, excel is suddenly not recognizing embedded images as legitimate.


I don't really change any Excel program settings...so on both laptop, the settings are default.  

Any ideas as to what the problem might be?  

 

Also, is there something that metaquotes can do to better format the xlsx file it outputs?

I found one answer on the microsoft answers forum from a user named dlauzon that I thought may get to the root of the bug.  As apparently some variation of it has existed since at least 2014.  Let me copy it here as a reference:

I had the same problem using Excel 2013 on an .xlsx file with images inside comments.

I was able to get the document back to a working state, and at the same time see where the corruption is.

Here's what worked for me (summary: remove a couple of bogus tags in an embedded text file):

  1. take a backup of the file (just in case)
  2. open the file and accept Excel's tentative to recover the file
  3. note the full path of the "removed part" file, e.g. "/xl/drawings/vmlDrawing2.vml"
  4. close the file without saving
  5. rename the file to end with .zip (e.g. myExcelFile.xlsx.zip)
  6. open the zip file, it shows as a folder hierarchy (if you're curious to see where your images are stored, I found them fully readable under the following folder in the zip file: \xl\media\ )
  7. extract the problematic file found in step 3, e.g. "/xl/drawings/vmlDrawing2.vml"
  8. open it with Notepad
  9. if you want to see what is wrong with this file, you can copy and paste its whole text content to an online XML syntax checker (e.g. http://www.w3schools.com/dom/dom_validate.asp).  Mine showed duplicate attributes on a given line (once you correct a line, you can re-paste your corrected text to find the next error, and so on).
  10. Here's the bug I had: all the v:fill tags had multiple o:relid attributes, even a working file has multiple, and it shouldn't, but in the case of the broken file, one of those attributes is different from the others, e.g.: v:fill o:relid="rId3" o:relid="rId3" o:relid="rId3" o:relid="rId3" o:relid="rId3"  o:relid="rId2"  <--- note the "rId2" instead of ="rId3" like the rest of the line
  11. for each v:fill tag, remove all but the last o:relid (in the previous example, that part of the line would now be v:fill o:relid="rId2" )
  12. once you have verified this for each v:fill, the XML of the file should be ok (step 9), save the file and put it back in the zip (overwriting the original one)
  13. rename the Excel file to its original name (e.g. myExcelFile.xlsx) by removing the .zip extension added in step 5
  14. open the file with Excel, everything is back to normal

The error is probably due to changes that force renumbering of the existing images such as removing a line on which there is a comment with a picture on it (if it's not the last picture added) - I can reproduce the bug every time I remove one such line.  We can see that just the last entry ("rId2") is corrected, the rest stay the same ("rId3"), and Excel can't cope with those different values for the same tag. 

To Microsoft: preventing multiple occurrences of the same attribute on a given tag should be the initial goal to solve this issue.

Note to @MetaQuotes Support is the embedded image xml format correct?  Can it be improved to avoid potential Excel flagging in the future?

Excel Worksheet and backups suddenly get Unreadable Content Message
Excel Worksheet and backups suddenly get Unreadable Content Message
  • answers.microsoft.com
I have a 400 line Excel 2007 single worksheet spreadsheet. Each row has a Comment inserted in one of the cells. The Comment has been formatted as follows: "Size" has been adjusted, "Colors and Lines"