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"
 

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

Back
Top