i Want to read excel sheet data in visula basic ... for manipulation of data.. plz give me the code .. for this..
How to read excel sheet in Visual basic
Collapse
X
-
Tags: None
-
Originally posted by uprakash14i Want to read excel sheet data in visula basic ... for manipulation of data.. plz give me the code .. for this..
Hi ,
Try this out
Dim xlsApp As Excel.Applicati on = New Excel.Applicati on
xlsApp.DisplayA lerts = False
xlsApp.Workbook s.Open("c:\myXl sFile.xls")
Dim xlSht As Excel.Worksheet = xlsApp.Sheets(1 )
Dim xlRng As Excel.Range = xlSht.Cells(1, 1)
Textbox1.Text = xlRng.Value
thanks
ansuman sahu -
thanx anshu..
but i want to full code for extracting excel sheet in Visual basic
plz help for thisComment
-
Originally posted by uprakash14thanx anshu..
but i want to full code for extracting excel sheet in Visual basic
plz help for this
FULL CODE..?
Open like in Anshu's Code , and Loop thru the cells, and populate a Grid...
[code=vb]
For i= 1 To 100
Grd.TextMatrix( i,1) = xlSht.Cells(1, 1)
Grd.TextMatrix( i,2) = xlSht.Cells(1, 2)
Grd.TextMatrix( i,3) = xlSht.Cells(1, 3)
Grd.TextMatrix( i,4) = xlSht.Cells(1, 4)
Next i
[/code]
Regards
VeenaComment
Comment