Long
Long

Reputation: 63

VBA/excel to dll/exe for Java

I have an Excel file with manual input functions, which use an add-in from a third party. I want to use the functionality of the Excel file in Java. I could think of two ways of doing it:

  1. code the functions in VBA, or VB with Excel reference, then generate .dll or .exe files for Java to use.

  2. Feed data to an Excel file using jxl (would Excel file update automatically when it receives new data?), then read the new result every time from the Excel file.

I don't have much experience with Excel or VBA. I want to know which method is more doable and faster.

Upvotes: 0

Views: 1245

Answers (2)

Christian Fries
Christian Fries

Reputation: 16932

Obba allows you to make calls from an Excel cell to a Java virtual machine (which may run on a different computer, if necessary). The JVM has to run Obba server (provided as a Java with main() method). The Obba server can load other JARs an instantiate objects via functional calls form the Excel sheet.

You could also use Obba to pass values, results to a Java code (or server).

(You may contact me, if you are interested in exploring this and need assistance (I work on Obba).

Upvotes: 0

mdma
mdma

Reputation: 57707

As your code is invoking a third-party add-in and is needs that for correct operation, then you will need to go the VB route or access Excel via the Automaton API (from Java, using for example, Com4j).

The reason is that the pure-java excel readers (jxl, Poi, xlSQL etc..) all use java to emulate the built in functionality of excel, but of cousre they cannot emulate third party add-ons.

Reading excel files using com4j is discussed in this thread.

Upvotes: 1

Related Questions