OutputTo ?

geralf

Registered User.
Local time
Today, 11:25
Joined
Nov 15, 2002
Messages
212
Hi

I'm using

DoCmd.OutputTo acOutputQuery, "qselAccAnDataToFile", "*.xls", strLoc, False

to output query data to Excel. Works fine. The Excel file is an old file format even though I have Office 2003. If I omit the output format, I'm prompted with a dialogue box which I can select the format I want (Excel 2003 or newer).

How would I specify a newer format in the above line of code?? I don't want the users to get the dialoue box

Thanks in advance
 
try...

DoCmd.TransferSpreadsheet acExport, 8, "qselAccAnDataToFile", "D:\DATABASE\test.xls", True, ""

with variable..

DoCmd.TransferSpreadsheet acExport, 8, "qselAccAnDataToFile", strLoc &".xls", True, ""




The 8 is the Excel version, which is 2000 I believe so experiment, I think if you leave it blank it will default to the latest version installed.
 
Thank you very much for the solution. This should solve my problrm.

Thanks again.
 

Users who are viewing this thread

Back
Top Bottom