Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-03-2008, 10:10 PM
Member
 
Join Date: Dec 2008
Posts: 3
Rep Power: 0
musicgold is on a distinguished road
Default Excel macros to control Java application
Hi,

Is there a way to create a macro to control a Java-based application interface? I have a Java based application on which I spend a lot of time doing repetitive tasks.
I use Excel based macros to access web pages and download files. I wonder if there is a similar way to have a macro in Excel which can open the Java application and feed the necessary information in its text boxes.

Thanks,

MG.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 12-03-2008, 10:39 PM
xcallmejudasx's Avatar
Senior Member
 
Join Date: Oct 2008
Location: Houston, TX & Flint, MI
Posts: 472
Rep Power: 1
xcallmejudasx is on a distinguished road
Send a message via AIM to xcallmejudasx
Default
Not sure about excel but you could write a java application to do that. load.exec("command.exe", some text file with the information)

This would require you to write a batch file that changes to the directory the java application is saved and then run it from there. As far as feeding the information to it I'm not sure
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-03-2008, 10:49 PM
Member
 
Join Date: Dec 2008
Posts: 3
Rep Power: 0
musicgold is on a distinguished road
Default
xcallmejudasx,

Thanks. Could you point me to a site where I can read the basics of creating the java application you mentioned?

MG.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 12-03-2008, 11:03 PM
xcallmejudasx's Avatar
Senior Member
 
Join Date: Oct 2008
Location: Houston, TX & Flint, MI
Posts: 472
Rep Power: 1
xcallmejudasx is on a distinguished road
Send a message via AIM to xcallmejudasx
Default
Do you know Java programming? If not then I wouldn't recommend this option because it may require some complex working.Java 2 Platform SE 5.0 is the class you use to open run a program from within Java. I know you can tell it what file to open using what program but I have no idea if you can also give it extra information and say populate some fields with information on load.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 12-03-2008, 11:16 PM
Member
 
Join Date: Dec 2008
Posts: 3
Rep Power: 0
musicgold is on a distinguished road
Default
xcallmejudasx,

Thanks. No, I don't know Java programming.

MG.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 12-03-2008, 11:23 PM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 3,195
Rep Power: 5
Fubarable is on a distinguished road
Default
You might want to try out a windows batch language such as WinBatch. They can help you automate repetitive tasks and since they're built to do this, they're a lot easier to use than Java or to try to shoehorn another language's macros to do something they weren't intended to do.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 04-25-2009, 05:30 PM
cpf cpf is offline
Member
 
Join Date: Apr 2009
Posts: 2
Rep Power: 0
cpf is on a distinguished road
Default
You can use Obba (Java Object Handler) to call Java methods (as well as working with Java objects) directly from Excel cells. Alternative it can be done with XLL4J, however this requires some additional coding in Java.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 04-25-2009, 07:30 PM
OrangeDog's Avatar
Senior Member
 
Join Date: Jan 2009
Location: Cambridge, UK
Posts: 820
Rep Power: 1
OrangeDog is on a distinguished road
Default
Most have missed the point of the OP. They want to control Java from Excel, not the other way around.

In short, it shouldn't be done. Excel macros are designed for writing macros for Excel, not for general batch tasks.
__________________
Don't forget to mark threads as [SOLVED] and give reps to helpful posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 04-25-2009, 10:43 PM
cpf cpf is offline
Member
 
Join Date: Apr 2009
Posts: 2
Rep Power: 0
cpf is on a distinguished road
Default
If I understand the original post correctly, then he has a some sophisticated functionality written in Java and he would like to access this functionality from excel.

While I would agree that you should use a macro (i.e., a vba sub) to control java, the solution to his problem could be to provide the required functionality as a user defined function. This function could be implemented in vba (as a vba function) or in C or C++ (as an XLL) or in Java. The additional functionality then is an add in (or plug in).

In the industry (e.g. finance) Excel is usually extended with add ins written in C or C++ or C# (xlls or dlls). The solution(s) I mentioned allow to extend excels FUNCTIONality via Java libraries.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache POI and VB macros Webuser New To Java 0 12-02-2008 06:10 AM
Java NetBeans IDE 6.1 Desing out of control, help needed!!! Please... equattro NetBeans 0 10-05-2008 07:35 PM
POI for delete excel record with keeping the existing macros Jay Advanced Java 0 07-31-2008 10:44 AM
POI - excel macros manipulation Jay Advanced Java 0 07-31-2008 10:04 AM
control app width based on certain control thebillybobjr SWT / JFace 0 05-15-2008 04:52 PM


All times are GMT +2. The time now is 12:21 AM.



VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org