title: '' is not a valid name. make sure that it does not include invalid characters or punctuation
body: <p>Here is my connection string</p>
  
  <pre><code>  Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=O:\[...].xlsx;Extended Properties='Excel 12.0 Xml;HDR=YES;'"
  </code></pre>
  
  <p>I dynamically extract the worksheet name straight out of the excel:</p>
  
  <pre><code>    Dim xlWorkSheet As Excel.Worksheet
      Dim xlApp As New Excel.Application
      xlApp.Workbooks.Open("O:[...].xlsx", 0, True)
      xlWorkSheet = CType(xlApp.Sheets(1), Excel.Worksheet)
      Dim sheetName As String = xlWorkSheet.Name
  
      Dim query As String = "SELECT [Part Number] FROM [" &amp; sheetName &amp; "$] WHERE [Sub-Category] = '-EEPROM'"
      Dim tempTable As New DataTable()
  </code></pre>
  
  <p>Then a classic OleDB transaction:</p>
  
  <pre><code>    Try ' OleDB transaction:
          Using co As New OleDbConnection(connString)
              Dim command As New OleDbCommand(query, co)
  
              ' Opens the connection
              co.Open()
  
              ' Perform the 1st query:
              Dim adapter As New OleDbDataAdapter(command)
  
              ' Fills in a table
              tempTable.Clear()
              adapter.Fill(tempTable)
  
              ' Disposes of objects
              adapter.Dispose()
          End Using
  
      Catch ex As Exception
          MsgBox("Error: " &amp; ex.Message,, "Error getting the EEPROM match")
      End Try
  </code></pre>
  
  <p>Aaaand I get the following error:
  'xxx' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long.</p>
  
  <p>xxx being the actual name of the worksheet, as seen in excel and retrieved through the excel object. </p>
  
  <p>Edit: And this name is letters and spaces only, 13 characters long.</p>
  
  <p>Slightly confused, and thanks for helping!</p>