Try this you might need to modify it a bit
Dim xlApp As Object ' Declare variable to hold the reference.
Dim xlbk As Workbook 'Declare Excel Workbook and worksheet
Dim xlsht As Worksheet
Dim mydb As Database
Dim myrec As Recordset
Dim x As Integer
Dim MySQL As String
Set xlApp = CreateObject("Excel.Application"

Set xlbk = xlApp.Workbooks.Add
Set xlsht = xlbk.Worksheets(1)
Set mydb = CurrentDb()
MySQL = ("SELECT * FROM [Table Name]"

'Enter Query Here
'Open the recordset with the mySQL Variable
Set myrec = mydb.OpenRecordset(MySQL)
myrec.MoveFirst
'entering data that fits criteria
Do Until myrec.EOF = True
xlsht.cells(x, 1) = myrec![Field Name]
xlsht.cells(x, 2) = myrec![Field Name]
xlsht.cells(x, 3) = myrec![Field Name]
x = x + 1
myrec.MoveNext
Loop
'pull up application with data
xlApp.Visible = True
You need to Reference the Excel Component as well