Reading from Excel

I've read some topics like this but I couldn't understand anything.
I just need help to just read what's written in specific column of Excel file.
And I need to search every row of one of the two columns for a word given through C++ code.

For example, I type something in console and program looks for that word in Excel file.

Thanks in advance :D
If you control the excel file, and its just values, you are far, far better off to export the excel file as CSV and parse this, as that is a text file.

Excel files in native excel binary format are extremely complex. I *think* visual studio has a widget that can read them. I *think* you can probably find a library online that care read them. DIY is going to take a while, even if you can find the format online.

Consider what all might be dumped into the binary of an excel file:

-the data
-formulae
-macros
-fonts
-vb widgits (buttons, etc)
- colors (cell colors, etc)
-styles of cells (formats)
-multiple sheets, with names
-images
-sounds (yes, you can play sounds in a spreadsheet.. I didn't know that either until recently)
-database connections (more in a sec)
-much more, this is a small random sample of some of it

if you have database stuff at your work and do that sort of thing as part of your job, you can connect to excel with it and push data back and forth, without reading the file at all.






Hello lemonsugar,

I would say the first part you will have to do is figure out and understand how Excel stores information in a .xlsx file. What you see in a nice spread sheet format on the screen is not the way it is stored in a file.

My suggestion is to save the .xlsx file as a .csv (comma separated value) file which is a plain text file and much easier to read and work with.

Hope that helps,

Andy
Topic archived. No new replies allowed.