I watched a tutorial and all codes where copied except for the path. But i get the error Could not find installable ISAM in the cn.open()
Here is the overall code:
Imports System.Data.OleDb
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OlEDB.4.0; Data Source:G:\Book1.xlsx;Extend Properties=Excel 8.0;")
cn.Open() <--Error Here
Dim da As New OleDbDataAdapter("Select * from [Sheet1$]", cn)
Dim dt As New DataTable
With DataGridView1
.AllowUserToAddRows = False
.DataSource = dt
End With
dt.Dispose()
dt = Nothing
da.Dispose()
da = Nothing
With cn
.Close()
.Dispose()
End With
cn = Nothing
End Sub
End Class
I hope anyone could help me. Thanks