Launching Excel

J

JimP

I've used code to export a CSV file. Is there a way to launch Excel now to
view the file? Note: it's important that the file be a CSV file and not
export directly to Excel format.
 
A

Andy Hull

Hi Jim

You can use the Shell command like...

Shell "C:\Program Files\Microsoft Office\Office\excel.exe c:\xltest.csv",
vbNormalFocus

or, if you are creating the file with OutputTo then set the AutoStart
parameter to True to automatically open the file with the application
associated with its extension (ie .csv almost always Excel)

DoCmd.OutputTo ObjectType, ObjectName, OutputFormat, OutputFile, AutoStart,
TemplateFile

Regards

Andy Hull
 
D

Douglas J. Steele

Or you should be able to use simply

Application.FollowHyperlink "c:\xltest.csv"
 
Top