Click here to Skip to main content
15,890,043 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Guys! I would like to learn how to copy data from a Excel worksheet to a VB.net application.

Lets say i have form 1.

Form 1 has:
3 text boxes : a name, address and age field.
2 Buttons : Save and Cancel

Then i have a excel worksheet, which contains the data.

Assuming that the data on the excel worksheet is thousands of rows, how could i programmatically get them from the excel sheet to my VB.Net Field?
(the example maybe simple, but my actual requirement is not this simple, i just want to learn how to get data from a excel worksheet to a VB.net application.)

What I have tried:

I tried searching google about my problem, but i cant find anything that would match, I also tried "Automation", but it also does not fit the requirement. I can't save a macro that would interact between Excel and my vb.net application. please do help! thank you!

ADD INFO.

I Learned How to transfer data from VB.net to Excel using VB.net codes, but it seems i have to use VBA to transfer data from excel to vb.net.
Posted
Updated 3-Jul-16 22:38pm
v2

1 solution

 
Share this answer
 
Comments
Joshua Magsino 4-Jul-16 20:25pm    
I think i need to code it in excel, would you know a link that would teach me how to transfer the data through VBA? thank you so much the the response!
Richard MacCutchan 5-Jul-16 3:22am    
You asked how to transfer data from Excel to a VB.NET application. How do you think VBA will help in such a problem?
Joshua Magsino 5-Jul-16 3:30am    
thats one of my problems too sir, im not quite sure IF its VB. But what I'm sure is, EXCEL should be the one who would carry out the work. I've seen this procedure before, and if i may describe it, "Excel automatically gets the data from the textbox as if someone is typing it". I'm not sure if it is VBA, or MACRO, but what i would like to really know, is how to get the value of a textbox from a VB.NET application to my Excel worksheet. I really just dont know what procedure should i use.
Richard MacCutchan 5-Jul-16 4:06am    
What you describe is a VBA macro not a VB.NET application. You need to read the documentation for VBA to see how to do it.
Joshua Magsino 5-Jul-16 4:15am    
I've read on several websites sir, sadly i have not found any clues on how to solve my problem. I thank you for taking the time to read and supply me with something i could start searching with.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900