Help request for vb .net in excel
Hi
Yes please let me know how to query data. For example, after reading data
A2:A10 , I wish to paste them in cells H2:H10 same sheet. I wish to know each
item of theses data as array, to be manipulated easily.
Many thanks for your time.
Best Regards,
kh
"campwes" wrote:
Here ya go:
Dim dbConn As OleDbConnection
Dim strConn As String
Dim strSQL As String
Dim rdr As OleDbDataReader
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=FileName.xls;Extended Properties=""Excel 8.0;IMEX=1"""
dbConn = New OleDbConnection(strConn)
dbConn.Open()
Dim cmd As OleDbCommand = dbConn.CreateCommand()
cmd.CommandText = " select * from [Sheet1$A2:A10] "
rdr = cmd.ExecuteReader()
Let me know if you need help with how to output the data from the query.
Cheers,
|