How i can read\export data within a C++ application to Excel files? I was found the xlslib project, but it only compiles with MingW on Windows. My target platform is windows (MVS2008)
Asked
Active
Viewed 8,414 times
3
-
1Which OS do you want to target? And which compiler? – AndiDog Feb 07 '10 at 22:00
-
2why not use simple CSV(Comma Separated Values)? – t0mm13b Feb 07 '10 at 22:17
-
1Unfortunately, manipulating Excel documents in C++ is not quite as easy as using the Microsoft.Office.Excel.Interop classes in .NET. In .NET, it's almost the same as coding in Excel itself. Native C++, from what I can tell, requires COM programming to access it and from the looks of it, it ain't pretty. – Nick Bedford Feb 07 '10 at 22:39
-
I need of formatting, thus i'm not using CSV – Lucas Feb 07 '10 at 22:53
-
Will Excel be installed on the machines the application will be used on? – Georg Fritzsche Feb 08 '10 at 01:22
-
have you tried http://npoi.codeplex.com/ ? – Francisco Feb 08 '10 at 01:49
-
yes, will Excel be installed on the target machines – Lucas Feb 08 '10 at 15:16
-
I'm developing a pure C++ win32 application, without .Net platform – Lucas Feb 08 '10 at 15:19
3 Answers
2
You can try this commercial library http://www.libxl.com, it works with Visual Studio 2008 and doesn't require Microsoft Excel.
1
If you're stuck with unmanaged C++ and need to communicate directly with Excel you'll need the COM automation interfaces. See the MSDN article link text
If you want the expressive power of the new managed interop, I think you may need to wrap your C++ code in an interop dll.

Mike Burrows
- 236
- 3
- 7
-
1Here is another link that has sample code: https://support.microsoft.com/en-us/kb/216686#/en-us/kb/216686 – Jerry Jeremiah Oct 12 '15 at 23:55
0
On windows, you can also give a try to ExcelFormat lib. http://www.codeproject.com/Articles/42504/ExcelFormat-Library
It doesn't require Excel installed, and it's very easy to use.

fduff
- 3,671
- 2
- 30
- 39