title: Insert Data from Excel into Access
body: <p>I've made some code to insert data from an excel table in to an access database - my code is as follow:</p>
  
  <pre><code>    Sub AddData()
  
  Dim Cn As ADODB.Connection
  
  Set Cn = New ADODB.Connection
  
  'lets connect to the workbook first, I tested this, it works for me
  Cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=sample.xls;Extended Properties=Excel 8.0;" _
  &amp; "Persist Security Info=False"
  
  ' Append data from Sheet1 of workbook to Table1 of mydb.mdb:
  Cn.Execute "INSERT INTO tblSales IN 'C:\Users\User\Documents\access.mdb' SELECT * FROM [datasheet]"
  
  Cn.Close
  Set Cn = Nothing
  
  End Sub
  </code></pre>
  
  <p>My problem is when executing this I get the error "Microsoft Jet Engine could not find the path to object "datasheet" . Datasheet is just the name of the sheet where the data is located in my workbook. Any help is much appreciated.</p>