Help request for vb .net in excel
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,
|