Exporting to a named worksheet and workbook

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
Hi David,

You can't do this with OutputTo. Instead, use TransferSpreadsheet and
specify the worksheet in its Range argument.
 
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.
 
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.
 
Back
Top