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

Excel on Mac problem open generated files #26

Closed
andershansson opened this issue Apr 7, 2017 · 26 comments · Fixed by #29
Closed

Excel on Mac problem open generated files #26

andershansson opened this issue Apr 7, 2017 · 26 comments · Fixed by #29
Labels

Comments

@andershansson
Copy link
Contributor

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

@andershansson
Copy link
Contributor Author

Worth mentioning is that LibreOffice handles the files just fine.

@Fabi755
Copy link
Collaborator

Fabi755 commented Apr 7, 2017

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.

@Fabi755 Fabi755 added the bug label Apr 7, 2017
@andershansson
Copy link
Contributor Author

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!

@Fabi755
Copy link
Collaborator

Fabi755 commented Apr 10, 2017

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.

@andershansson
Copy link
Contributor Author

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!

@andershansson
Copy link
Contributor Author

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.

@andershansson
Copy link
Contributor Author

andershansson commented Apr 10, 2017

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
Copy link
Owner

xou commented Apr 17, 2017

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.

@andershansson
Copy link
Contributor Author

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.

@mspanc
Copy link

mspanc commented Apr 20, 2017

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.

@andershansson
Copy link
Contributor Author

@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
Copy link
Owner

xou commented Apr 23, 2017

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?

@mspanc
Copy link

mspanc commented Apr 23, 2017

Here it is

Workbook1.xlsx

excel for mac 2011
version 14.7.3 (170325)

@mspanc
Copy link

mspanc commented Apr 23, 2017

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
Copy link
Owner

xou commented Apr 30, 2017

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

@mspanc
Copy link

mspanc commented Apr 30, 2017

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

@xou
Copy link
Owner

xou commented May 3, 2017

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! :)

@xou
Copy link
Owner

xou commented May 7, 2017

@mspanc
Copy link

mspanc commented May 7, 2017

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

@mspanc
Copy link

mspanc commented May 7, 2017

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
Copy link
Owner

xou commented May 12, 2017

Ok, another one ;)
empty2.xlsx

@mspanc
Copy link

mspanc commented May 12, 2017

Works fine

@andershansson
Copy link
Contributor Author

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

@xou
Copy link
Owner

xou commented May 13, 2017

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

@xou xou reopened this May 13, 2017
@andershansson
Copy link
Contributor Author

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
Copy link
Owner

xou commented May 14, 2017

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

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

Successfully merging a pull request may close this issue.

4 participants