Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8046385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:46:11+00:00 2026-06-05T05:46:11+00:00

In an MS Access public function, I run a java xslt module using a

  • 0

In an MS Access public function, I run a java xslt module using a shell call:

Set shell = CreateObject("WScript.Shell")
cmd = "java -jar D:\saxon9he.jar -s:D:\input.xml -xsl:D:\transf.xslt -o:D:\output.xml"
Set objExecObject = shell.Exec(cmd)

I caught the following error:

VBA java call error

As exactly the same worked fine in another MS Access instance, I assume I have to refer to an environment variable somewhere (one of these is JAVA_HOME which has been set to C:\Program Files\Java\jdk1.5.0_16\bin).
But where in MS Access can I set that reference?
Or is this error caused by something else?
Might there for instance be trouble with MS Access / VBA accessing the environment variable PATH in USER and/or SYSTEM? In my setup, it’s the user environment paramater PATH that holds the information on the location of java.exe.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:46:13+00:00Added an answer on June 5, 2026 at 5:46 am

    I added stuff to the command to be executed as follows:

    Set shell = CreateObject("WScript.Shell")
    Dim JavaHome As String
    JavaHome = shell.Environment("USER")("JAVA_HOME") & "\"
    cmd = JavaHome & "java -jar D:\saxon9he.jar -s:D:\input.xml -xsl:D:\transf.xslt -o:D:\output.xml"
    Set objExecObject = shell.Exec(cmd)
    

    This works fine, as I now supply the path to java.exe myself.

    But I still wonder, why all of a sudden MSA/VBA could not apply the PATH parameter from user environment (which includes ;%JAVA_HOME%;) any more…

    I will create another thread for that question…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to run the following C function from Java using JNA, but
Using MS Access, I tried to run an SQL statement but I can't make
I keep getting this error: Warning: mysql_query() [function.mysql-query]: Access denied for user 'mcabinet'@'localhost' (using
In a regular .aspx page, you can access public properties from the codebehind. Is
How can I access a variable in one public class from another public class
How do you think about data access code like this: public void AddCusotmer(Cusotmer customer)
I'm trying to access a static method in a Utils class I created: public
Do I have to lock access to instance members? Example: public class HttpModule :
I have the following enum. public enum DATABASE_TYPES { JDataStore, Access, SQLServer, H2, PostGresSQL,
My base controller class, BaseController , is inherited by public-facing controllers to access a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.