Call Java Code from VBA

Posted on 2012-08-31
Last Modified: 2012-09-27
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 (,
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.
Question by:finaris
    1 Comment
    LVL 20

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
    Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
    This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
    This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now