The Artima Developer Community
Sponsored Link

Java Answers Forum
Running an Excel program from Java

4 replies on 1 page. Most recent reply: Nov 20, 2005 9:40 PM by Joe Parks

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
Chadi A.

Posts: 1
Nickname: ambitionwe
Registered: Oct, 2005

Running an Excel program from Java Posted: Oct 24, 2005 7:00 AM
Reply to this message Reply
Advertisement
Greetings,

I'm looking for advice or even service/consulting from someone who has done this kind of task before.

I have an excel sheet that has embedded formulas and actually complex VB code. You can enter data in certain cells, hit the "run program" button and then see results of computation in certain cells.

I need someone to tell me how I can access this excel and execute VB code from a java application. Please note: I can read and write to excel, so that is not the issue. The big problem is "running" the excel program which us VB code. I'm trying to do this in apache TOMCAT server.

I've searched and read that it can be done through JNI, but I'm unable to find something clearly defined or close.

I greatly appreciate your advice!

C.A.


Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: Running an Excel program from Java Posted: Oct 24, 2005 11:47 PM
Reply to this message Reply
> I've searched and read that it can be done through JNI,
> but I'm unable to find something clearly defined or
> close.

I have never used VB, but JNI enables you to make calls
to libraries written in Native (C or C++, etc), if VB
has simlar libraries, then it should be possible to make
calls to VB libraries. Making calls to libraries that your
application uses, to me is similar to executing the VB
application itself. Hence that would be like you're using
Java to execute the VB application.

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Running an Excel program from Java Posted: Oct 24, 2005 11:58 PM
Reply to this message Reply
I think Excel offers COM access wich you can use to do pretty much everything.

Only thing you need is a Java-COM Bridge like J-Integra (that's the one I'm using).

Hao Zhang

Posts: 1
Nickname: talk2hao
Registered: Nov, 2005

Re: Running an Excel program from Java Posted: Nov 18, 2005 12:46 PM
Reply to this message Reply
Like Matthias said, using a Java-COM Bridge like J-Integra for COM, you can easily access/modify MS Excel from Java client. You can find more information about it at http://j-integra.intrinsyc.com

J-Integra for COM's pure Java runtime talks to COM components using Distributed COM (DCOM) layered over Remote Procedure Calls (RPC). The RPCs are themselves layered on TCP/IP. Therefore, at the lowest level, J-Integra for COM uses standard Java networking classes.

Here's an very simple example to show you how easy to access Excel from Java client:
http://j-integra.intrinsyc.com/support/com/doc/index.htm#excel_example.html

Cheers,

Hao Zhang

J-Integra Interoperability Solutions
http://j-integra.intrinsyc.com/
high performance interop middleware for java, corba, com & .net

Joe Parks

Posts: 107
Nickname: joeparks
Registered: Aug, 2003

Re: Running an Excel program from Java Posted: Nov 20, 2005 9:40 PM
Reply to this message Reply
There's also an open-source COM bridge called "JACOB" available on SourceForge:
http://sourceforge.net/projects/jacob-project/

Flat View: This topic has 4 replies on 1 page
Topic: Protected method in an Interface Previous Topic   Next Topic Topic: Java & XML

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use