Solved

Saving Access query to Excel file on hard drive

Posted on 2011-02-18
3
263 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:marku24
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 48

Accepted Solution

by:
Dale Fye earned 250 total points
ID: 34929506
0
 

Author Comment

by:marku24
ID: 34950950
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
 

Author Comment

by:marku24
ID: 34955175
This export worked.  I used
 wbk.SaveAs FileName:= "C:\temp\filename.xlsx"
to save the file to my drive.  

Thanks
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question