Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Office For Mac, reports error and discards styles when opening file #17

Closed
brucepom opened this issue Jan 22, 2017 · 2 comments
Closed

Comments

@brucepom
Copy link
Contributor

Thanks for the great project!

This can be reproduced by creating the simplest possible file then trying to open it in Microsoft Excel for Mac (https://products.office.com/en-ca/buy/compare-microsoft-office-products?tab=tabs-2).

For example if you run the example from the readme:

Workbook.append_sheet(%Workbook{}, Sheet.with_name("Sheet 1") |> Sheet.set_cell("A1", "Hello", bold: true)) |> Elixlsx.write_to("hello.xlsx")

Then open the resulting file with Office for Mac results in the following warning:

image

If you click "Open and Repair" the file will open but be displayed with no styling and a prompt as follows:
image

If you click "View" to see the log you'll see:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>Repair Result to hello1050.xml</logFileName><summary>Errors were detected in file '/Users/bruce/Work/viewprogis/viewprogis_web/vpg/hello105.xlsx'</summary><removedParts summary="Following is a list of removed parts:"><removedPart>Removed Part: /xl/styles.xml with XML error.  (Styles) Load error. Line 36, column 36.</removedPart></removedParts><repairedRecords summary="Following is a list of repairs:"><repairedRecord>Repaired Records: Cell information from /xl/worksheets/sheet1.xml</repairedRecord><repairedRecord>Repaired Records: Cell information from /xl/worksheets/sheet2.xml</repairedRecord></repairedRecords></recoveryLog>

Suggesting a problem with xl/styles.xml

I think I have found a solution and will submit a pull request soon.

@brucepom
Copy link
Contributor Author

Thanks again, please check out #18 which resolves the issue.

@xou
Copy link
Owner

xou commented Jan 28, 2017

Awesome, thank you for your help!!

@xou xou closed this as completed Jan 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants