outputTo - Export to Microsoft Excel 97-2002 (*.xls)

G

Guest

Hello, I am having a problem exporting to Excel. I have a Memo field that
keeps getting cut off at 255 characters. If I manually run the query, select
File>Export and select Microsoft Excel 97-2002 (*.xls) it will work fine and
not cut off the field at 255 characters. However, I would like to create
Macro and use the OutpuTo Action. When I select the OutputTo format and then
Microsoft Excel 97-2002 (*.xls), it changes it back to Micosoft Excel (*.xls)
and cuts off the characters. I believe it has to be in the 97-2002 format.
I am using MS Access 2002.

Your help is greatly appreciated.
 
K

Ken Snell [MVP]

Don't use OutputTo action, use TransferSpreadsheet action instead. The
former uses old EXCEL format that doesn't support text strings longer than
255 characters; the latter allows you to select the newer version of EXCEL
and thus export the longer text string.
 
G

Guest

Thanks Ken,
If I use TransferSpreadsheet it only prompts me for a Table Name. I want to
runa query first and then transfer the results from the query. The query
prompts for parameters. How can I do this using a macro?

Thank you,
Grace
 
K

Ken Snell [MVP]

The table name argument can be either a table name or a query name. Just put
the name of the query in that argument.
 
G

Guest

Once again, Thanks Ken ....

When I put the query name in the table name field, it gives me an error
message that says "Too few Parameters". I believe this is because the query
is a parameter query. Whey won't it run the query and prompt for the
parameters?
 
K

Ken Snell [MVP]

How are you calling this macro? My tests show that a parameter query prompts
for the parameters when I do the TransferSpreadsheet action in a macro.
--

Ken Snell
<MS ACCESS MVP>
 
G

Guest

Thanks again,
It now works. I had the Transfer Type set to "Import" instead of "Export".
Once I changed it, it worked! Thanks again for your help.

Grace
 

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