Read data from Excel file

pardreamer

New member
Joined
Jun 22, 2007
Messages
1
Programming Experience
Beginner
Hi all,

I am a newbie, please help me with this:

I have an excel file with 3 columns of data:

Size A B

001 1.000 1.250
002 2.000 3.000
003 2.500 3.750
....
...
999 25.075 27.225

1. How do I populate a combo box with 1000 sizes without using Items.Add("001")?
2. My output will be A+B, for example, if user selects 003, then output is 6.250? How do I assign A and B values without using 1000 If-Then statements?

thanks very much,

Jimmy
 
Last edited:
You can connect to an Excel file through OLE DB as if you were connecting to an Access database to retrieve data. Check out this site:

http://www.connectionstrings.com/?carrier=excel

I am not sure what you want to accomplish in the second part of the question but there are many ways to get you the result you wanted:

1. Store A+B as the Value of the combo item
2. Store the key 003 as the value and use it to requery the file and do A+B
3. Put the data in an array, then retrieve and add...
 
Back
Top