Solved

Export Access query to defined Excel spreadsheet

Posted on 2008-10-11
2
1,031 Views
Last Modified: 2012-05-05
Hello,

I have a query that I would like to export to a specific sheet within an Excel workbook. Is this possible? Below is my macro code
Function mac_excel_patient_export()

On Error GoTo mac_excel_patient_export_Err
 

    DoCmd.TransferSpreadsheet acExport, 10, "qry_excel_patient", "c:\test\data.xls", True, ""
 
 

mac_excel_patient_export_Exit:

    Exit Function
 

mac_excel_patient_export_Err:

    MsgBox Error$

    Resume mac_excel_patient_export_Exit
 

End Function

Open in new window

0
Comment
Question by:Dozingquinn
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 400 total points
ID: 22695677

  DoCmd.TransferSpreadsheet acExport, 10, "qry_excel_patient", "c:\test\data.xls", True,"SheetName"
 
0
 

Author Closing Comment

by:Dozingquinn
ID: 31505373
Thanks for your skills
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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

16 Experts available now in Live!

Get 1:1 Help Now