aspose file tools
The moose likes Java in General and the fly likes Post Java execution, opening completed file on Windows Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Post Java execution, opening completed file on Windows" Watch "Post Java execution, opening completed file on Windows" New topic
Author

Post Java execution, opening completed file on Windows

Sean Davidson
Greenhorn

Joined: Jan 10, 2011
Posts: 6

I have this program where I take in an excel file and manipulate it, I currently have it saving to a specific folder. Is there anyway I can have that file open on the user's computer after the program has executed.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12268
    
    1
Are we talking about a HTTP server / client browser architecture here?

Bill

Java Resources at www.wbrogden.com
Sean Davidson
Greenhorn

Joined: Jan 10, 2011
Posts: 6

No I have this little Applet / Application for my company, it simply takes in an excel file, highlights specific cells. Then saves the new file.

I want my program to open that file on the user's computer once it is saved.

EDIT: So the user doesn't have to go in and open the file him/herself.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24054
    
  13

By "Open that file" you mean "Launch Excel with that document opened", yes?

You would use Runtime.exec() to run a command like "cmd.exe /c start foo.xls" . The classic article on Runtime.exec() -- which you absolutely should read! -- is here. It will tell you exactly what to do, and what not to do.


[Jess in Action][AskingGoodQuestions]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Or use java.awt.Desktop's open method.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Sean Davidson
Greenhorn

Joined: Jan 10, 2011
Posts: 6

Thank you very much, I'll try it in a minute.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Post Java execution, opening completed file on Windows
 
Similar Threads
Finding the packages for a source file
free a csv file without closing the java program?
Could you unzip a file with a java program
Manifest file to jar
pdc viewer software needed