How to determine col names in excel sheet.

dgage

Member
Joined
Jul 23, 2007
Messages
14
Programming Experience
10+
Hello all. I am writing an app that will allow a user to select an excel file (done), display the sheet names (done) and finally, display the column names within that sheet ( not done ).

I am not sure how to get the column names, and it is entirely possible that although the app works (so far), I may just be doing it wrong.

At any rate, here is the code I have so far (attachment - help.txt) . If someone could show me , or point me in the right direction on how to determine the column names, I would be very grateful.
- Doug
 

Attachments

  • help.txt
    1.6 KB · Views: 20
Last edited:
i wasnt aware that excel columns had names, beyond the basic A B C D E .. AI AJ AK AL AM

i.e. the second row, second column.. that is cell B2, and thats it!
 
Sorry if I am not clear. I do not mean the headers (A,B,C, 1,2,3...).
The first row in the sheet has column names, like 'Publisher', 'Title', etc. (Cell A1 = 'Publisher, cell B1 = 'Title'). These are the names I wish to get at.

The rows that follow have publisher name, book title, etc. When I do the select statement, I cannot seem to 'get' that first row of 'column names', only the rows that follow.

- Doug
 
you are referring to the cell values...

as for the select statement you can put the values in there if you know them ahead of time. If you can't however, you can build them dynamically using row(x) col(y).... I don't remember the exact syntax.. you'll need to look that up.

hope that helps.
 
Back
Top