Excel gives an error opening the .xlsm file

Issue #666 resolved
created an issue

Hi all, I've the similiar problem with xlsm file. I can open it with excel 2016 on Win 7 but i can't open on windows 10. I'd already checked region settings between 7 and 10. They're same. When i choose "to recover as much as we can?" the records are repaired with this message "Repaired Records: Format from /xl/styles.xml part (Styles)" the log is

<?xml version="1.0" encoding="UTF-8" standalone="true"?> 
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> <logFileName>error020560_01.xml</logFileName> 
<summary>Errors were detected in file 'C:\Users\serife.yilmaz\Desktop\34 Hafta nakit planlama.xlsm'</summary> 
<repairedRecord>Repaired Records: Format from /xl/styles.xml part (Styles)</repairedRecord>

the data format is not right in the cells after repair. For example it has to be "8.905.696" but it is "8905695.914" how i can fix it? thank you 1.JPG2.JPG

Comments (12)

  1. Francis Caron

    I am having the same issue. I am using a xlsm template to produce reports. So I am opening the template and saving it as a new .xlsm file.

    Having the same error message when opening the created file. Also, only emf images seems to be conserved. Png images are deleted from the file.

  2. CharlieC

    Thanks for the file. The problem is not related to the macro functionality but this is a huge and very complicated file so it's going to take a while to see exactly what the problem might be but it looks to be related to the defined names in the file. That images others than those related to the macros are preserved is to be expected: openpyxl does currently not preserve images in existing files.

  3. CharlieC

    The problem seems to be related to the way worksheet titles that contain apostrophes are serialised: they need doubling to be escaped. ie. 'Demande d'autorisation' needs to be 'Demande d''autorisation'. It also looks like the definedName for the filter database is duplicated.

  4. Francis Caron

    Thank you for the very quick response! The image problem is not related to this issue but as it was mentioned, I'd like to know if there is a possible work around to preserve the images?

  5. Log in to comment