Ok, here is how you connect to your Access db, populate a recordset, create a new Excel workbook, and copy the entire recordset into sheet1.
VB Code:
  1. Option Explicit
  2. 'Add a reference to MS Excel xx.0 Object Library
  3. 'Add a reference to MS ActiveX Data Objects 2.x Library
  4. Private Sub Command1_Click()
  5.     Dim oRs As ADODB.Recordset
  6.     Dim oCnn As ADODB.Connection
  7.     Dim oApp As Excel.Application
  8.     Dim oWB As Excel.Workbook
  9.     Dim i As Integer
  10.     'Connect to your Access db
  11.     Set oCnn = New ADODB.Connection
  12.     oCnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\RobDog888.mdb;Persist Security Info=False"
  13.     oCnn.Open
  14.     'Create your recordset
  15.     Set oRs = New ADODB.Recordset
  16.     oRs.Open "SELECT * FROM Table1;", oCnn, adOpenKeyset, adLockReadOnly, adCmdText
  17.     'Create an instance of Excel and add a new blank workbook
  18.     Set oApp = New Excel.Application
  19.     oApp.Visible = False
  20.     Set oWB = oApp.Workbooks.Add
  21.     'Add the field names as column headers (optional)
  22.     For i = 0 To oRs.Fields.Count - 1
  23.         oWB.Sheets(1).Cells(1, i + 1).Value = oRs.Fields(i).Name
  24.     Next
  25.     oWB.Sheets(1).Range("1:1").Font.Bold = True
  26.     oWB.Sheets(1).Cells(2, 1).CopyFromRecordset oRs
  27.     oRs.Close
  28.     Set oRs = Nothing
  29.     oCnn.Close
  30.     Set oCnn = Nothing
  31.     oWB.Close SaveChanges:=True, FileName:="D:\Test.xls"
  32.     Set oWB = Nothing
  33.     oApp.Quit
  34.     Set oApp = Nothing
  35. End Sub