Transfer Multiple queries on a single sheet using do.cmd

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have three crosstab queries that needs to be placed at the different
ranges in the same excel sheet .
How can I achieve this with do.cmd.transferspreadsheet.

Dim strQName As String
strQName = "7a-query"
Dim strNewName As String
strNewName = "c:\file.xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, strQName,
strNewName, True

I have the sample code here.
Now, how can I put the second query(which is 7b-query) on the same
tab,"7a-query" at the range, G2?
Thanks,
Prasanna.
 
Hi,
I tried adding the Range with the following addition to the Docmd code.

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, strQName,
strNewName, True,G2:x

This gave me the error.
Please help
thanks,
Prasanna.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top