Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Saving Access query to Excel file on hard drive

Posted on 2011-02-18
3
Medium Priority
?
273 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 49

Accepted Solution

by:
Dale Fye earned 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

916 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