I am writing a program that needs to read in an excel file and I would rather not resave the file as a text file. So the question is can I just open a file stream for the excel file and read the data like I would in a text file.
I am writing a program that needs to read in an excel file and I would rather not resave the file as a text file. So the question is can I just open a file stream for the excel file and read the data like I would in a text file.
It might be easier if you saved the document in csv form.
Then it would be very easy to pull the info.
Unless you know the format of an excel file I don't think it will be very easy to do it that way.
A normal excel file would be undecipherable I think.
If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?
If you're using Excel I'm guessing your using VC++. The good news yes you can, the bad news is the plumbing is not trivial. I recommend using MFC and its CDatabase and CRecordset classes or and more likely a better approach would be using ATL OLE DB.
You can look these up on MSDN there are lots of ODBC and OLE DB samples. As a starting point I'd look for "Creating an OLE DB Consumer" and "Creating an OLE DB Template Provider".
There are also some good books on it such as "OLE DB and ODBC Developer's Guide". It covers both.
I hope that helps.
dang