12

I'm looking for a free C++ library that can load .xls files in both Windows and Linux. If I had to make a choice, Linux would be the bare minimum.

I've tried LibXL, but got this amazing error:

"can't read more cells in trial version"

So now I'm on the hunt for a free version :), unfortunately xlsLib doesn't provide the ability to load existing .xls files.

Thanks

Jake88
  • 914
  • 1
  • 20
  • 35
  • 1
    Borrow an implementation from something like OpenOffice or Gnumeric. Prepare to be horrified at the file format however. – Yann Ramin May 20 '10 at 18:45
  • 1
    If it only needs to run on Windows, you could access Excel as a COM component. We do this in our software, but this is Windows only (no Linux) and requires Excel to be installed on the computer. – Patrick May 20 '10 at 19:08
  • Possible duplicate of http://stackoverflow.com/questions/493111 – Sharjeel Aziz May 20 '10 at 19:28
  • Yes I read that article earlier, but that was started a year ago and I was hoping there had been new developments since then. That's why I mentioned them earlier in my post. If there are any solutions other than resulting to COM and VB, please post them. – Jake88 May 20 '10 at 20:05

3 Answers3

15

We have had success with: ExcelFormat

dtw
  • 1,695
  • 1
  • 12
  • 13
  • 1
    ExcelFormat is not bad. It's limited to 65K rows, and can only read the old .XLS format. You'll have to convert all your .XLSX to .XLS – Pierre Oct 23 '16 at 14:17
5

This looks promising for .xslx files: https://github.com/tfussell/xlnt

user357269
  • 1,653
  • 10
  • 37
0

Please take a look at XLSX I/O, which is a C library released under MIT license for both reading and writing .xlsx files from C/C++.

It's cross platform and specifically designed to allow streaming a lot of data to and from .xslx files with low memory footprint.

Only depends on expat and libzip. Tested on Windows (MinGW), Linux and OS X.

Brecht Sanders
  • 4,723
  • 1
  • 11
  • 29
  • 1
    Since this appears to be your own project, please do read [How to offer personal open-source libraries?](https://meta.stackexchange.com/q/229085) before creating more copies of your answer. – Martijn Pieters Mar 23 '16 at 16:14
  • I currently do not need the source myself, but I would recommend that you share your code on a platform such as github. It just to make it easier to read, understand and trust before committing to a download. – Jake88 Mar 24 '16 at 21:16