Solved

Can Java be used to write OLE Automation clients?

Posted on 2009-04-01
2
742 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 125 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jar file executable 12 58
MySqlDump not dumping triggers 1 43
servlet web applications   metadata-complete="true" or false 3 123
restrict decimal places for double datatype 10 22
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

828 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