Exporting to a named worksheet and workbook

G

Guest

Hello,

I have used the DoCmd.OutputTo to export data from a query to a user defined
..xls file.

I now want to export data to a Sheet2 in a spreadsheet, which I know the
name of.

I am not clear whether the parms in DoCmd.OutputTo allow for a worksheet to
be named as the destination of the export.

Any ideas?
 
J

John Nurick

Hi David,

You can't do this with OutputTo. Instead, use TransferSpreadsheet and
specify the worksheet in its Range argument.
 
G

Guest

Note the Help file will tell you TransferSpreadsheet will fail if you try to
use the Range argument for an export. That is not true, it does work.
 
G

Guest

That did the trick. Thanks John.
--
David


John Nurick said:
Hi David,

You can't do this with OutputTo. Instead, use TransferSpreadsheet and
specify the worksheet in its Range argument.
 

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

Top