I have an excel sheet with 2 tables both wit 6 columns an each starts at columnB
Table1 with headers starts at B16:G16 AND ENDS AT B62:G62.
Table2 with headers starts at B91:G91 AND ENDS AT B118:G118.
I want to load table1 to Datagridview1 and table2 to Datagridview2
Please help

    Dim MyConnection As System.Data.OleDb.OleDbConnection
    Dim DtSet As System.Data.DataSet
    Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
    MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='C:\Users\korisnik\Desktop\" & File.Text & "';Extended Properties=Excel 8.0;")
    MyCommand = New System.Data.OleDb.OleDbDataAdapter("select Sifra , Amount from [Ispis$]", MyConnection)
    MyCommand.TableMappings.Add("Table", "Net-informations.com")
    DtSet = New System.Data.DataSet
    MyCommand.Fill(DtSet)
    DataGridView1.DataSource = DtSet.Tables(0)

Remember, to get ans. you will have to describe your probs. and the exception what are you facing. No one here to do the ans. finding qus./excp. from your post.
Please make your post more distinct.

From my opinion, 1) an exception can occur from the contruction of your connection string(no single quotation is needed).
2) Nowhere you tried to open the connection object.

commented: Nice answer. +15
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.