Macro: Exporting to Excel - Pre-naming Worksheet

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?
 
S

Steve

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
 
K

Ken Snell \(MVP\)

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.
 

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