Solved

Export Access Queries to different sheets in Excel

Posted on 2009-05-12
2
236 Views
Last Modified: 2012-06-21
Hi Experts

The following runs to two separate excel sheets but i'm trying to get the data to run to sheet 1 and then sheet 2 in the same excel workbook.

any help or suggestions is greatly appreciated :)

ozgirl

  DoCmd.OpenForm "PleaseWait", acNormal, "", "", acReadOnly, acNormal
    DoCmd.RepaintObject acForm, "PleaseWait"
    DoCmd.SetWarnings False
    DoCmd.OpenQuery "qryDataDump_Cleanse"
    DoCmd.SetWarnings True
    DoCmd.Close acForm, "PleaseWait"
    DoCmd.OutputTo acTable, "tmpDataDump", "MicrosoftExcelBiff5(*.xls)", "", True, "", 0
    DoCmd.OpenQuery "qryDataDump_Cleanse_Tasks"
    DoCmd.OutputTo acTable, "tmpDataDump_b", "MicrosoftExcelBiff5(*.xls)", "", True, "", 0
    DoCmd.SetWarnings True
    DoCmd.Close acForm, "PleaseWait"
0
Comment
Question by:ozgirl
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 24370606
docmd.transferspreadsheet acexport, acSpreadsheetTypeExcel9,"QueryName1","C:\myExcel.xls",true,"Sheet1"

docmd.transferspreadsheet acexport, acSpreadsheetTypeExcel9,"QueryName2","C:\myExcel.xls",true,"Sheet2"
0
 

Author Closing Comment

by:ozgirl
ID: 31580797
Thanks Heaps  :)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

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 the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

758 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

20 Experts available now in Live!

Get 1:1 Help Now