October 7th, 2003, 12:44 PM
reading an excel spreadsheet
is it possible to read data from an excel spread sheet in C++?
I need to read data from a spread sheet and analyze the data.
October 7th, 2003, 01:01 PM
I know there are ways (I used to write data to spreadsheets all the time, but never read from one), but how often are you going to be doing this? If it is only once, I suggest you save the data in tab or comma delimited format and process it that way. It is very inefficient to read/write data into/out of out-of-process objects.
October 7th, 2003, 04:18 PM
It is actually a large data file that i wil be getting from someone else.
Anyway how do we write data to a excel sheet. i think i will be asked to output data to excel spread sheet.
October 7th, 2003, 04:25 PM
The code I used for that was in VB, so I don't expect it to be very valuable in this forum. I imagin there are examples on the web, but the biggest problem I ever had was in finding documentation for the calls (actually, I never did find any documentation).
As an aside, I believe you can create an ODBC link to an Excel spreadsheet, you may want to look at that idea also.
October 8th, 2003, 12:22 AM
The easiest way is .csv files. these are excel files where the cells are seperated by commas. Can be viewed in notepad or excel.
Not good for complex formulars....
>>I believe you can create an ODBC link to an Excel spreadsheet
This is the easiest way to go if .csv files are not complex enough (AFAIK) but will require the PC to have a DSN or FILE DSN added.
Look at the MFC CRecordSet class if you have a standard sheet.
The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.