wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Launch Excel problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Launch Excel problems" Watch "Launch Excel problems" New topic

Launch Excel problems

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299

I am trying to run excel from java using

This is not working. However, if I specify the absolute path it does work. But if I click start -> run and type excel and press enter, somehow windows knows where to find it without the absolute path.
I need to be able to launch Excel without knowing where it is on a PC. Does Excel make some sort of environment variable similar to %systemroot% or something like that?
Any help??

GenRocket - Experts at Building Test Data
Sigfred Zamo
Ranch Hand

Joined: Mar 04, 2002
Posts: 44
Well, I think you'll have to locate a registry key in Windows where Excel has a string value asigned with his root path, and then get it from your Java code..
Hope this helps.

Sigfred Zamo<br />Software Development<p><a href="http://www.sigfredo.ingenieros.net/index2.html" target="_blank" rel="nofollow">My page</a>
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
There is an "InstallRoot" associated with Excel in the Windows Registry.
If you go to
In the window that comes up Select
HKey Local Machine
I have an 8.0 and a 9.0 - select one
It names the path to find Excel.
I have not a clue how to do this using java .

"JavaRanch, where the deer and the Certified play" - David O'Meara
jQuery in Action, 2nd edition
subject: Launch Excel problems
Similar Threads
Absolute/Relative path of jar file?
Viewing data from database into an xls format not working
package problem
Multiple JDK's and JRE's
How to get file information of any folder?