Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading data in from Excel

Status
Not open for further replies.

cathym

Programmer
Jul 17, 2002
25
US
I have an extensive Excel spreadsheet with many references and calculations. To ease the load, I want to write a c++ program to read the data into a one dimentional array of structs, do some sorts and some calculations, and then spit the data back out to a separate part of the spreadsheet. If I were using .dat or .txt files instead of an Excel spreadsheet, there would be no problem. How do I actually capture a number out of a cell on a spreadsheet? With as little overhead as possible.
 
I do not have the answer for you off the top of my head but your first clue might be to look at what an excel sheet looks like under NOTEPAD or your other favorite text editor.

It may be as simple as a dat file with extra overhead/headers/footers/app data. And you may need to filter through these to find your data. =====================
Insider
4 year 'on the fly' programmer
C++ Basic Java
 
I know that iwth ActiveX and Visual Basic you can take control of excel and read/write cells. I have not done it with visual C but I think it is possible. You can also save out to Tab Delimited format from excel.

-Chris (Consultant / Software Engineer)
 
Yes, it is possible to automate Excel with Visual C++. If you are interested in details, tell me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top