Launching Excel

  • Thread starter Thread starter JimP
  • Start date Start date
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.
 
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
 
Or you should be able to use simply

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