943,807 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 3451
  • C++ RSS
Mar 11th, 2009
0

How to Read Excel File

Expand Post »
I'm creating a program in Visual C++ and the program I'm creating needs to read a data in an Excel document. It was saved in .xls format.

Can someone help me on how to read data in an Excel file. No need for writing or editing the excel document, just a read function. I found lots of codes on how to manipulate an excel file but it seems too complicated for me since I'm just a noob in C++. Maybe a very simple sample code on how to read from an Excel file.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
everard is offline Offline
21 posts
since Mar 2009
Mar 11th, 2009
0

Re: How to Read Excel File

It's not as easy as it sounds, since there is alot of information in an xls file, ofcourse there are different versions too. http://sc.openoffice.org/excelfileformat.pdf

Normally when you are a beginner looking at something like this, you would use CSV files, as they are much easier to read etc. Please note, we will not provide code solutions for you, you will need to do some work yourself and show evidence of the fact you have done so.

Chris
Last edited by Freaky_Chris; Mar 11th, 2009 at 6:22 am.
Reputation Points: 325
Solved Threads: 118
Master Poster
Freaky_Chris is offline Offline
702 posts
since Apr 2008
Mar 11th, 2009
0

Re: How to Read Excel File

Can you show me a very simple example on how to read an excel file saved on a CSV format.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
everard is offline Offline
21 posts
since Mar 2009
Mar 11th, 2009
1

Re: How to Read Excel File

Please note, we will not provide code solutions for you, you will need to do some work yourself and show evidence of the fact you have done so.
It's really not to hard, if you know some basic file handling techniques you can do it no problem.
It can get a bit more advanced but to start with it's simple enough, and I'm sure if you do some research; it would be even easier.

Chris
Reputation Points: 325
Solved Threads: 118
Master Poster
Freaky_Chris is offline Offline
702 posts
since Apr 2008
Apr 10th, 2009
0

Re: How to Read Excel File

You can try 3rd party commercial library for this task, for example: http://www.libxl.com. It has an easy interface.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dmytro is offline Offline
6 posts
since Apr 2009
Apr 10th, 2009
0

Re: How to Read Excel File

If you want to write to Excel files you can use xlsLib
However I would recommend to use CSV-files (as already mentioned) because they're more C++ friendly and it's just easier to read out the data using some simple file handling techniques ...
Last edited by tux4life; Apr 10th, 2009 at 9:03 am.
Reputation Points: 2125
Solved Threads: 243
Postaholic
tux4life is offline Offline
2,105 posts
since Feb 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Header and Cpp file relations in wxWidgets
Next Thread in C++ Forum Timeline: Help with if statement and output





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC