Following Function will return the table name at the given position(eg, excel sheet) or return blank
Private Function GetTableName(ByVal ConnectionString As String, ByVal TableNumber As Integer) As String
Dim i As Integer
Dim dtXlsSchema As DataTable
Dim myConn As New OleDbConnection
myConn.ConnectionString = ConnectionString
myConn.Open()
dtXlsSchema = myConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, _
New Object() {Nothing, Nothing, Nothing, "TABLE"})
If TableNumber > dtXlsSchema.Rows.Count Then
Return ""
Else
Return dtXlsSchema.Rows(TableNumber - 1).Item("Table_Name").ToString
End If
End Function