xou/elixlsx

Excel on Mac problem open generated files

Closed this issue · 26 comments

When I try to open the generated file(s) using Excel (version 15.32 for Mac) I get a warning/error that the file is broken and that a repair is needed. (See the attached screenshot).

Is this a known problem or something that has never been tested? Any ideas?

screenshot 2017-04-07 11 35 45

Worth mentioning is that LibreOffice handles the files just fine.

Hey, thanks for your report.

I can not reproduce this.. generating with the example and open with same version works fine.
Please add your code that generate your excel file to evaluate this.

Unfortunately the code is part of a proprietary code base and I cannot freely share it. I'll try to replicate with a minimized version to replicate it!

One thing I did notice was that I set the bg_color to #000000 (black) and fg_color to #FFFFFF (white) for some of the cells but they end up being colored with a black dots on a white background instead of white text on black. It could be related to this (maybe). Other bg_colors and fg_colors seems to be working in other cells. (All is showing up fine and looking good in LibreOffice).

I'll get back with an example to replicate it as soon as possible!

I'll try to replicate with a minimized version to replicate it!

That will help to find the problem, thanks.

One thing I did notice was that I set the bg_color to #000000 (black) and fg_color to #FFFFFF (white) for some of the cells but they end up being colored with a black dots on a white background instead of white text on black.

This bug has already fixed in #20 but is not published on hex.pm yet. This will only cause that the first used background color ended up in black dots.

One thing I did notice was that I set the bg_color to #000000 (black) and fg_color to #FFFFFF (white) for some of the cells but they end up being colored with a black dots on a white background instead of white text on black.

This bug has already fixed in #20 but is not published on hex.pm yet. This will only cause that the first used background color ended up in black dots.

Ah, thank you. I'll try to get the version directly from git instead!

Ah, thank you. I'll try to get the version directly from git instead!

Unfortunately this breaks things with the bg colors in general and shuffles around the colors and some of them becomes white instead (loses the styling).

I'll provide code to replicate.

I found the problem why the cell background colors was breaking and I've created a PR with a fix.

Getting back to the original issue here with broken files needing repairs, I've verified that it is being replicated by using the example file in the repository.

I'm attaching the generated example.xslx file to this comment.

Most likely this may have something to do with the version of Elixir/OTP I'm running maybe?

Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Elixir 1.4.2

empty.xlsx

xou commented

I unfortunately don't have a mac, so I can't directly debug this. Does this happen with all files generated by the current elixlsx HEAD version? (even empty ones?) If not, can you try to provide a minimal example that causes that warning message?

re @Fabi755's comment about the version not being on hex.pm yet, sorry about that, as soon as we figure out what's happening here i'll update the hex.pm version.

Yes, even empty ones are showing the same problem. If you generate a file from the example file in the repository and attach it here I can try to see if I can determine the difference and maybe that will give us some clue what is happening.

I have the same issue using 0.1.1.

Here is the file generated by the library

RadioJAZZ.FM - STOART - 4-2017(1).xlsx

that is causing this error:

screen shot 2017-04-20 at 23 09 36

I also see gray background as dotted.

@mspanc I had the same issue and I've submitted a PR with a fix for the dotted background issue some week ago. I believe it has been accepted and merged in HEAD if you switch to that instead of the hex package it should work.

xou commented

Yep, i'll push the fix for the grey background out as soon as we've figured out what's happening with the import error.

Unfortunately, I don't have access to MS office, neither on windows nor on mac.
Does this problem occur with older elixlsx versions as well? Would you mind attaching an empty xlsx file generated by Office for Mac?

Here it is

Workbook1.xlsx

excel for mac 2011
version 14.7.3 (170325)

Here's the file I generate:

Reggae Dub - STOART - 4-2017.xlsx

and here's the same file saved by excel for mac after clicking "Open and repair" button:

Reggae Dub - STOART - 4-2017 - repaired.xlsx

xou commented

Looking that the diffs between the files I couldn't really figure out what was going on.
I've created a few files manually using components from an elixir empty file and the one you provided. Can you open them and check if there is one of them that does not show the "needs to be repaired" warning? Cheers
custom-xl-workbook.xlsx
custom-xl-theme-theme1.xlsx
custom-xl-theme-style-contenttype-merged.xlsx
custom-xl-styles.xlsx
custom-xl-sheet.xlsx
custom-xl-contenttypes.xlsx
custom-docprops-core.xlsx
custom-docprops-app.xlsx

Only custom-docprops-app.xlsx does not show warning.

xou commented

Ok, weird. I can't see anything obviously wrong with that file (according to http://www.datypic.com/sc/ooxml/t-extended-properties_CT_Properties.html all fields are optional), i'll set up another set of files later this week.

Thanks for testing! :)

Only app-appversion.xlsx does not show a warning.

I made a mistake in the previous comment and if you read this thread via mail notifications you might see the old version. So I repeat: Only app-appversion.xlsx does not show a warning.

xou commented

Ok, another one ;)
empty2.xlsx

Works fine

I can also confirm that the last one works in Excel on my Mac without warnings.

xou commented

Can you checkout the current HEAD and see if the problem is resolved?

I've verified that it now works with my generated files on Mac!

From my perspective this issue has been resolved! Great work! Thank you!

xou commented

Sweet. Closing this, thanks everyone for the help in figuring this out :)