Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Can Java be used to write OLE Automation clients?

Posted on 2009-04-01
2
Medium Priority
?
820 Views
Last Modified: 2013-11-23
I.e. with Visual Basic I can write simple code like

Set objXLApp = CreateObject("Excel.Application")
objXLApp.Visible=True
objXLApp.Quit

or the like.  Can Java do this to?  If so, what would be equivalent Java code to the above?  And what would I need to compile and/or interpret the Java code (i.e. I'd need VB to compile it as an EXE or just write VBScript code and save it as a .vbs file - what would I need for Java?)

Thanks!!!!
DTXCF
0
Comment
Question by:DalTXColtsFan
2 Comments
 
LVL 17

Expert Comment

by:Thomas4019
ID: 24044640
java's Runtime class allows to you execute windows comands, Runtime.getRuntime().exec(). Or an even easier way is Desktop.open(File f).
0
 
LVL 4

Accepted Solution

by:
freer earned 500 total points
ID: 24044685
If you are happy to run only on Windows, there are OLE Automation libraries for Java. One comes with the free Eclipse SWT library see:

http://download.eclipse.org/eclipse/downloads/documentation/2.0/html/plugins/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/ole/win32/OleAutomation.html

It's more complex to use than VB though.

Tim
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question