Click to See Complete Forum and Search --> : Running an Excel program from Java


ambitionweb
10-24-2005, 10:10 AM
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 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.

BigDog
10-24-2005, 04:14 PM
You wouldn't actually run the VB script inside Java. JNI basically just allows you to call external programs. So you would write a seperate VB program to do whatever you need with the spreadsheet, and just invoke that program with JNI.

As far as I have ever heard, I know of no product out there that runs VB code inside of Java.

Waylander
10-24-2005, 09:35 PM
Do you have a specific need to use java? crossing .net and java isnt going to be much fun in general...

I would recommed either re-writing your expressions into java code and runing it all from within tomcat, or just building your entire application using vb.net.

Waylander.

talk2hao
11-18-2005, 03:44 PM
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

Oak
11-20-2005, 10:24 AM
Does that count as advertising? ...