Exporting to a named worksheet and workbook

D

David

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.
 
K

Klatuu

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.
 
D

David

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.
 
Top