docmd.Outputto acFormat.xls

C

cirrusminor81

I have a command to Output to an Excel File

Example:

DoCmd.OutputTo acOutputQuery, "8205-Orders-ShippedOrders-01", acFormatXLS,
"P:\edi\To_ee\EarthEasy Shipped.xls", True


When I do this, it opens the file in Excel 97/5.0 format. Is there a way so
I can get it to format in Excel 2003 format? I would like to save it
automatically in the newer version.

Thanks
 
F

fredg

I have a command to Output to an Excel File

Example:

DoCmd.OutputTo acOutputQuery, "8205-Orders-ShippedOrders-01", acFormatXLS,
"P:\edi\To_ee\EarthEasy Shipped.xls", True

When I do this, it opens the file in Excel 97/5.0 format. Is there a way so
I can get it to format in Excel 2003 format? I would like to save it
automatically in the newer version.

Thanks

Try the TransferSpreadsheet method instead:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8,
"8205-Orders-ShippedOrders-01", "P:\edi\To_ee\EarthEasy Shipped.xls",
True

Note: the True argument in the above code is not the same as the True
argument in the OutputTo method.

Then if you wish to immediately open it:
Application.FollowHyperlink "P:\edi\To_ee\EarthEasy Shipped.xls"
 

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