Compatible EXCEL format

I have an app that will run for macOS or Windows, and one of its features is to create an Excel spreadsheet…
The method I am using geneates XML data based on the Microsoft Excel 2004 specifications… and is saved with an XLS extenstion

When I load it using Microsoft Office 2011 for Mac, it loads just fine and looks exactly as I would expect.
On Excel version 15 for Mac it indicates an improper format (so say Simon Berridge)
I had another friend try on a Windows machine running Excel 2007 and 2010, and it would NOT load with the XLS extension, but changing it to XML it loaded correctly.

In the past I had never had issues with an XLS file being XML contents as long as it properly defined a Microsoft format.

Anyone else have experience in this arena? (Note : using Excel API is not an option, as it must run on all platforms, and the user may not even have excel installed)

Entirely possible
There are old formats that newer versions won’t open (almost like they lost or deliberately left that code out or something)
And if you create a newer xlsx older versions may not open it
Such joy

It always struck me as one way they forced everyone to update to newer versions.
If you had 2004 and I had 2015 and I sent you a spreadsheet you’d complain to me about “I cant open it” to which I’d say “Well update”
And if you sent me a spreadsheet that mine wouldn’t open you would get the same reply

And the world stayed on the MS update treadmill

No… If I had and older version of Excel and you send me a file from a New version, I would politely ask you to resend it after telling Excel to save it in a legacy format (I bet if you check, the latest Excel will save back to at least 2007 if not before)

I only have Excel 14 for Mac and it opens the XLS files fine

When your accountant says “send me X in a spreadsheet” and then replies “I cant read that you need to send me something my version of excel can read” … you update
At least I do otherwise my taxes dont get filed :slight_smile:

Hi Dave - I struggled against the mighty M$ machine for years - even produced our own classes or producing the really old BIFF (actual binary) format and the combined XML format used by later editions (before xlsx came along). These tended to open just fine in OpenOffice, but we were getting more and more issues with later versions of Excel not being able to open the files (usually profile settings, or just plain old incompatibility).
So, eventually bit the bullet and trialled MBS LibXL plugin - not only does it give you a simple choice between xls and xlsx formats but you can operate on existing spreadsheets (filling forms required in Excel format - though why anyone thinks that’s a good idea is beyond my comprehension, but we deal with govt agencies that require exactly that and our clients prefer a completed form rather than having to copy and paste). I’d urge you to try it out - sure you need to buy LibXL licences for each platform you want to use the library with, but it’s truly cross-platform (incl iOS) - we’re using just the Windows, Linux and OSX platforms currently, but can add iOS any time. And it’s free to try.

Thanks Matthew. but that is WAY overkill for what needs to be done here… there is no fancy formatting, no formulas, not even column sums… its basically a grid with numbers or text… the cost to profit ratio is too high… I’ll just leave it producing the 2004 XML format, and the user can adjust as required (seems older Excel can load these with XLS extension, and new Excel requires the XML extension)…

And wasn’t it Microsoft that at one time said “look at the files CONTENTS, not the file extension”??? but it is what it is :slight_smile:

Just out of interest as it was me that reported the issue to Dave I use the Einhuger plugin that now produces xlsx format Excel files. I think this is currently still pre-release but it gives outstanding results in all my tests.

I know that Dave is not a lover of plugins but I was finding that my own xls classes that produces xml format Excel files was not being read by all.

I think xlsx file format is around for 10 years or so. it’s time to update if someone can’t open it !
and if the customer doesnt want to buy M$, then openoffice will do the job.

Well, if you guys look for a big Excel file library, check my XL Plugin:

Read/write XLS and XLSX.

And older Excel version have been able to install ‘new format reading plugins’ for years.
So you could can Office 2013 files in Office 2010

The real issue, as Dave is finding, is stopping Excel from complaining about the content of a file that ends in .XLS
If there have been several ‘internal’ formats that end .XLS, its Microsoft’s job to look at the content and handle it.

Mind you, Ive been guilty of sending a CSV file with an XLS extension in the past, and that used to work.
Now you get the same message: which is annoying because we all know Excel can open it… it would be a handful of rows of code to have it ‘just open the da m n file’ instead of complaining…

There is a demo of Excel 2016 on the Microsoft site. Why not save in a format readable by it from the Mac version, save it on PC, and see what the differences are ?

I love that answer !

I should say “libreoffice” will do the job.
it appears that libreoffice opens a lot of files types (and specially old ones) compared to openoffice
plus it’s really free.

Dave’s problem is not so much to open an isolated file, but to generate one that the leader can open.

As for myself, I do have Microsoft Office, but I see myself using Open Office more often. Libre Office being an offshoot of it, I would expect the same performances.

You are right Jean-Yves, LibreOffice from The Document Company. I understand what you wrote and do not notice it was not what I read ;).

I too use LibreOffice in both my macOS Sierra and Windows 10 laptops.

It seems Microsoft is not consistent in backwards compatiblity…

I generate a file that has Microsoft 2004 XML contents, but with an XLS extension

  1. Microsoft Office 2011 for Mac opens that file with no issues
  2. Excel version 15 for Mac will open it if loaded from WITHIN Excel, but not if dbl-clicked from Finder (per Simon Berridge)
  3. Excel 2007 and Excel 2010 for Windows, would only open it if the extension was changed to XML, then it was fine

Yay for MS and “random backwards compatibility” :stuck_out_tongue:

Did just find that by adding a specific XML tag to the file,
that WIndows 2007 and 2010 will now load the file properly…
but Warns the user that the contents (XML) doesn’t match the extension (XLS)
where before the extension had to manually be changed…
So I consider that a step in the right direction :slight_smile:

Have you tried to generate the same file from Excel 2010 or Excel 2016 and see what the differences are with your original format ?

If you emulate the pickiest, chances are it will also work flawlessly for Excel Mac.

I will have to see if I have any version of Excel installed on my Window VM,
good idea.