views:

561

answers:

4

I'm using wxWidgets to write cross-plafrom applications. In one of applications I need to be able to load data from Microsoft Excel (.xls) files, but I need this to work on Linux as well, so I assume I cannot use OLE or whatever technology is available on Windows.

I see that there are many open source programs that can read excel files (OpenOffice, KOffice, etc.), so I wonder if there is some library that I could use?

Excel files it needs to support are very simple, straight tabular data. I don't need to extract any formatting except column/row position and the data itself.

+2  A: 

Suggestedd reference: http://stackoverflow.com/questions/493111/what-is-the-best-c-library-that-can-access-excel-files

I came across other libraries (chicago on sf.net, xlsLib) but they seem to be outdated.

jrh

Here Be Wolves
Maybe xlsLib will do the job. I can always tell users to save in Excel 97 format and be done with it. Thanks.
Milan Babuškov
+1  A: 

Maybe http://www.libxl.com/ can help ?

Begemot
A: 

I think that it is not something easy to do. xls files are quite complex and it is a proprietary format.

Maybe this is a stupid idea but why don't you upload and access your doc with Google docs. There are some apis to access your doc.

2 potential problems: - Your app needs internet access - Currently there is no C++ api.

But there are api for several languages including python see http://code.google.com/intl/fr/apis/gdata/articles/python_client_lib.html

luc
resisting urge to downvote
Here Be Wolves
Ok. Thts't just an idea. I agree that it is a bit strange and that in this case, libxl for example is certainly a better choice but i think that google spreadsheet is now more and more popular. I think it shouldn't be forgotten in the list of excel-like applications.
luc
+1  A: 

I can say that I know of a wxWidgets application that reads Excel .xls and .xlsx files on any platform. For the .xlsx files we used an XML parser and zip stream reader and grab the data we need, pretty easy to get going. For the .xls files we used: ExcelFormat, which works well and we found the author to be very generous with his support.

Maybe just some encouragement to give it a go? It was a couple of days work to get working.

dtw