This will get the data from the excel and put it in the dataset. Then you can do whatever you want to do with it.
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim myPath As String = filepath
Try
Dim DS As System.Data.DataSet
Dim strPath, strSheet As String
strPath = filepath
strSheet = "Sheet1"
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
MyConnection = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & filepath & ";Extended Properties='Excel 12.0 Xml;HDR=YES'")
' Select the data from Sheet1 of the workbook.
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [" & strSheet & "$]", MyConnection)
DS = New System.Data.DataSet
MyCommand.Fill(DS)
If Not DS Is Nothing Then
Return DS
Else
Return Nothing
End If
Catch exp As Exception
MsgBox(exp.Message)
Return Nothing
End Try