Call Java Code from VBA

Hello Experts,

i would like to call functions from a java .CLASSor .JAR file from VBA.

One possibility is to use the bidirectional ComBridge ComfyJ (http://www.teamdev.com/comfyj),
which offers to register a COM server in the Windows Registry so that it can be used within VBA using the following code:

Sub Test()
Dim objTest As Object
Set objTest = CreateObject("jniwrapper.comtojavasample.1")
Debug.Print objTest.myJavaMethod()
objTest = Nothing
End Sub

Open in new window


The only problem with this aproach is the use of the registry. In case that the end-user does not have administrative privileges, the registry might be inaccessible.

Does anyone know another approach for this?


Please note: Writing the external code in C/C++ instead of Java is NOT an option.
finarisAsked:
Who is Participating?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.