Hey all,
I currently have some code to import a spread into a dataset but it is dependant on the name of the sheet ie sheet1$. I would like this import to work on the first sheet of a xls file no matter what the sheet name is. Any ideas?

vb Code:
  1. Private Function GetAllRows(ByRef objCon As OleDb.OleDbConnection) As DataSet
  2.         Dim results As New DataSet("ExcelRows")
  3.         Dim com As New OleDb.OleDbCommand("select * from [sheet1$]", objCon)
  4.         Dim da As New OleDb.OleDbDataAdapter()
  5.         da.SelectCommand = com
  6.         da.Fill(results)
  7.         Return results
  8.     End Function