OutputTo command

J

JCP

I'm using the outputo command as the following procedure

DoCmd.OutputTo acSendForm, "G1_Data", "Microsoft Excel 97-2003(.xls)",
"C:\Allocsyt\Test.xls", False, , 0

This procedure creates a excel file but with the format microsoft Excel
5.0/95.

Question.
How can i use the procedure above and generating excel file with the format
Microsoft Excel 97-2003?

Thanks
 
D

Douglas J. Steele

Use the TransferSpreadsheet method instead, which allows you to specify a
specific format.
 
J

JCP

Hi Douglas,
I tried to use TransferSpreadsheet method but doesn't do what I want.

I need export data from datasheet view form where the format numbers and the
columns width are properly formated.

If I use OutputTo method it works fine, except the excel format. is
microsoft 5.0/95 and not Microsoft Excel 97-2003.

With this method, one click I export the data from datasheet view with the
same format that we see in the form.

I tried to use TransferSpreadsheet but it export only tables and keep the
original columns format in excel. The titles in excel is not format

So, do you have any solution to use OutputTo method and give the porperly
excel formtat?

Thanks
 
D

Douglas J. Steele

AFAIK, there's no way to change how OutputTo works.

You could, however, use TransferSpreadsheet, and then use Automation to
format the data in Excel.
 
J

JCP

If there is not solution I think is much better and quickly use OutputTo
method and with automation save as for Microsoft Excel 97-2003 format.

Is it possible to export data from recordset to excel using
TransferSpreadsheet method?

Thanks
 
D

Douglas J. Steele

If you're asking whether a instantiated recordset can be exported to Excel
using TransferSpreadsheet, the answer's no (and the same's true of the
OutputTo method).

You can, however, use the GetRows method of the recordset in conjunction
with Automation.
 
J

JCP

With automation I use CopyRecordsetFrom method. I never used GetRows method.

What is the best method, GetRows or CopyRecordsetFrom?

Thanks
 

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