stephen-hardy / xlsx.js

XLSX.js is a JavaScript library for converting the data in base64 XLSX files into JavaScript objects - and back! Please note that this library is licensed under the Microsoft Office Extensible File License - a license NOT approved by the OSI. While this license is based off of the MS-PL, which is OSI-approved, there are significant differences.
http://blog.innovatejs.com/?tag=xlsx-js
Other
575 stars 122 forks source link

File not read by Excel:mac 2008 #2

Open billymoon opened 11 years ago

billymoon commented 11 years ago

I am trying to read the generated file on my mac, but it fails when trying to open with error:

Excel cannot open this file.
The file might have been damaged or modified from its original format.

I can however, see the contents of the file by previewing with the space key, so I know the file has downloaded correctly.

nickarnold commented 11 years ago

This is just a hunch, but I suspect this might be due to non-Mac fonts specified in line 84. Here is the element that specifies the font:

<fonts count="1" x14ac:knownFonts="1">
  <font>
    <sz val="11"/>
    <color theme="1"/>
    <name val="Calibri"/>
    <family val="2"/>
    <scheme val="minor"/>
  </font>
</fonts>

Also, on line 82 there are multiple <a:font /> elements that reference different fonts. I don't have any Apple products so I cannot test this theory myself. I know Office for Mac 2008 installs fonts, but if they don't match those referenced by these lines it could cause a runtime error.

Please, someone with access to Office 2008 for Mac, test this and let us know.

stephen-hardy commented 11 years ago

Hello billymoon and nicholasjarnold,

Are you provided the opportunity to get further information about the error, at any point? I do not have access to a copy of Office for Mac 2008, but I know that with Excel 2010 the user has the option to get information about what internal xml file, and line, caused the error.

Also, could you send me a copy of the Excel file so that I might examine it?

As for nicholasjarnold's theory regarding the font, I would doubt that is the problem. Being that XLSX.js does not yet support formatting, the nodes you mention are static and identical to that of a newly created spreadsheet from Excel 2010. Were it a font problem, the same problem would also occur for generic Excel 2010 spreadsheets. This would mean that any Windows-created Excel file would not work on Mac Excel, without first modifying the document so that it used cross-platform fonts. However, since I don't have a copy of Office for Mac 2008 on which to test, I could be wrong.

Thanks, Stephen

billymoon commented 11 years ago

I have no idea how to get the information you want out of excel. If you could point me somewhere to show me how, then I can get the information for you.

Here is the file: http://cl.ly/0N272o2a190q

Cheers

radicand commented 10 years ago

I ran into a lot of Mac repair errors but was able to determine they were caused by me specifying a font size postpend (e.g., pt or px). Removing this and leaving the font size as just a number made the warnings go away.