[RESOLVED] Import excel to Windows Form (VB.NET)
Hi, have anyone experience this kind of problem?
I need to drag and drop excel file, or just simply open it from OpenDialogFile, but when opening the excel file, I need it to show the specific cells (eg A1) in the textbox.text or label.text, and that's it!
I did search everywhere, but I didn't find the way how to do it.
Can I do what I want in VB.NET only? or i must use excel macro vba to support? because this project can't use any database support, it's just only a stand alone application that produce excel from vb.net and if the user need to edit, it will use the same application.
any idea?
Thanks.
Re: Import excel to Windows Form (VB.NET)
Oh i got it, this is the section of the code...
vb Code:
oExcel = CreateObject("Excel.Application")
oExcel.Visible = True
oBooks = oExcel.Workbooks
oWB = oBooks.Open(TextBox1.Text)
oSH = oWB.Worksheets("Sheet1")
TextBox5.Text = oSH.Cells(1, 1).Value.ToString
this link was helpful..
http://vb.net-informations.com/excel..._open_file.htm
Thanks anyway.
Re: [RESOLVED] Import excel to Windows Form (VB.NET)