wood burning stoves 2.0*
The moose likes Mac OS and the fly likes opening excel from java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Mac OS
Bookmark "opening excel from java" Watch "opening excel from java" New topic
Author

opening excel from java

amit vijayant
Greenhorn

Joined: May 04, 2005
Posts: 1
On Mac excel can be opened by command like
open -a 'Microsoft Excel'
However when using the same from java:
Runtime.getRuntime().exec("open -a 'Microsoft Excel'");
This fails. Any ideas?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60781
    
  65

I've never actually tried running any OS command like this (on OS X or any other system), but you might try specifying the full path to the application as in:



not sure if that's the issue or not, but it's the first thing I'd give a try.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Could it be that you don't need the single quotes around the application name? From the command line you wouldn't have them.

Welcome to Javaranch Amit!
 
Don't get me started about those stupid light bulbs.
 
subject: opening excel from java
 
Similar Threads
Basic authentication & showing EXCEL
Rename Excel File using Java
Reading files have .xls extension
need to create excel and need Save As dialog boxes.
How to implement TREND()