views:

34

answers:

1

Hi, I have an excel file with mannually input functions, which use an add-in from a third party. I want to use functionalities 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 excel file using jxl (would excel file update automatically when it receives new data?), then read the new result everytime 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.

Thanks!

A: 

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.

mdma