Saving Access query to Excel file on hard drive

I would ike to take an Access select query and have it write to an Excel file on my hard drive using VBA.  I'm not sure where to start.
marku24Asked:
Who is Participating?
 
Dale FyeConnect With a Mentor Commented:
0
 
marku24Author Commented:
hanks fyed, this worked really well.  I just have two questions, 1) when it copies to the excel sheet is there code that I can tell it to save that excel file to my hard drive?  Like FileSave C:Temp\Filename.xls? and 2) can I change a parameter and have it include the column headings from the Access query.  Right now it just skips the first row where the headings are suppose to go.  Thanks
0
 
marku24Author Commented:
This export worked.  I used
 wbk.SaveAs FileName:= "C:\temp\filename.xlsx"
to save the file to my drive.  

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.