Solved

Saving Access query to Excel file on hard drive

Posted on 2011-02-18
3
219 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
  • 2
3 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 250 total points
Comment Utility
0
 

Author Comment

by:marku24
Comment Utility
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
Comment Utility
This export worked.  I used
 wbk.SaveAs FileName:= "C:\temp\filename.xlsx"
to save the file to my drive.  

Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now