How to use Excel Libraries in C++ Project

closed account (D8pLy60M)
I want to read/write the excel sheet using C++.

Can please anyone suggest me how to add the excel library or include the headers ?

Inot possible than is there any other way to work on Excel using C++.
I want to read/write the excel sheet using C++.

Are you just talking about reading and writing to an existing Excel sheet, or do you need to be able to manipulate the sheet in other ways?

Andy
Last edited on
closed account (D8pLy60M)
Manipulate the sheets

Adding new sheets & adding values to its rows & columns.
The project that coder777 provided a link to looks rather dated (it's a Visual Studio 6.0 project!) and only deals with .xls files, not the newer .xslx format (introduced in Office 2007.) The codeproject.com page does also warn that its code only a subset of the functionality ("it contains only very basic functionality...")

It is interesting in that it works without Excel, using the Structured Storage API, but that's why it's limited to old school .xls files; .xls (and Word .doc files) are structured storage files whereas .xslx (and .docx) are structured zip files containing XML files plus resources.

One of the ways Microsoft exposes the Office functionality is via the Office COM Automation API, which does require Excel to be installed on the target machine.

C++ app automates Excel (CppAutomateExcel)
http://code.msdn.microsoft.com/office/CppAutomateExcel-be36992e

I did find an open source project: SpreadsheetLight
http://spreadsheetlight.com/

But they only support the newer .xlsx format. (I didn't look too hard, though.)

Andy

Office 2010 for developers
http://msdn.microsoft.com/en-us/office/ee513173.aspx

And in case you're interested, this project provides an app which can be used to open a compound document /structured storage file to see what's inside.

Another OLE Doc Viewer but with editing facility
http://www.codeproject.com/Articles/7453/Another-OLE-Doc-Viewer-but-with-editing-facility
Last edited on
Topic archived. No new replies allowed.