Macro: Exporting to Excel - Pre-naming Worksheet

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

Guest

Macro: When you export to Excel , the Query Name becomes the worksheet name.
Is it possible to pre-name or prompt user to name the worksheet when
exporting to Excel?
 
No.
--

Ken Snell
<MS ACCESS MVP>






- Show quoted text -

When I am exporting to Excel, I do it via a macro. (hope I'm not doing
something wrong given Ken's comment so would appreciate any feedback
if I am)
Macro:
Action:OutputTo
Parameters (bottom of screen)
Object Type:Query
ObjectName:Name of your query
Output Format: Microsoft Excel 97-2003 (*.xls) (choose from drop down)
Output file:put path and name of excel file here eg C:\files\test.xls
Autostart:Choose yes or no depending on whether you want to see the
result in Excel straight away
Template File: Blank
Encoding:Blank.

Sorry if I have overworked the detail but I know how much detail I
need on any help.
Hope this is useful
Steve
 
Steve said:
When I am exporting to Excel, I do it via a macro. (hope I'm not doing
something wrong given Ken's comment so would appreciate any feedback
if I am)
Macro:
Action:OutputTo
Parameters (bottom of screen)
Object Type:Query
ObjectName:Name of your query
Output Format: Microsoft Excel 97-2003 (*.xls) (choose from drop down)
Output file:put path and name of excel file here eg C:\files\test.xls
Autostart:Choose yes or no depending on whether you want to see the
result in Excel straight away
Template File: Blank
Encoding:Blank.

Sorry if I have overworked the detail but I know how much detail I
need on any help.
Hope this is useful
Steve

There is nothing "wrong" with what you're doing (so long as you understand
that OutputTo will truncate memo fields at 255 characters), but what you're
doing is not allowing the user to "define" the name of the worksheet as part
of the export.

TransferSpreadsheet works similarly, except it won't truncate memo fields if
you use the Microsoft Excel 97-2003 (*.xls) format.
 
Back
Top