how to define a specific sheet in outputto macro

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

Guest

I have a macro that I am using the OutputTo function. The output is into an
excel file. It does the function just fine, but I would like to specify the
worksheet name to us. It defaults to the Query name for the excel worksheet
name

query abc

excel file bad.xls
current file and sheet names
Bad.xls worksheet=abc

I want the output from abc
to go into sheet named Data
final file
Bad.xls with a worksheet named Data

I don't want to change the query name though.

thanks,
 
Try using TransferSpreadsheet instead of OutputTo, and pass the
worksheet name in the Range argument. You may need to append a ! or $,
e.g.
Data!
 
Back
Top