Computing.Net > Forums > Programming > Executing Java program from VBA

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Executing Java program from VBA

Reply to Message Icon

Name: T. Watson
Date: September 22, 2003 at 14:31:01 Pacific
OS: Windows 2000
CPU/Ram: x86 Family 6 Model 8 Step
Comment:

I am exectuing a Shell function from VBA that executes a .bat file which issues a java call.

START "CSV Loader" javaw -DINSTALL_DIR="C:\Program Files\GPM\qa\" -classpath "../../lib/jlicense.jar;../../lib/enyevent.jar;../../lib/enyobjex.jar;../../lib/enyware.jar;../../lib/enyeventutils.jar;../../lib/enycom.jar;../../lib/enycomimq.jar;../../lib/enycomseebeyond.jar;../../lib/enytoplink.jar;../../lib/enyutils.jar;../../lib/swingextras.jar;../../lib/IBMExt.jar;../../lib/jcert.jar;../../lib/jnet.jar;../../lib/jsse.jar;../../lib/jce.jar;../../lib/SAX.jar;../../lib/DOM.jar;../../lib/jdom.jar;../../lib/jms.jar;../../lib/jmq.jar;../../lib/classes12.zip;../../lib/stcjms.jar;../../lib/te_enabler.jar;../../lib/Sybase_jConnect-5_2.jar;../../lib/csvloader.jar;../../lib" com..loader.CSVLoader -nameURL $INSTALL_DIR$\config\CSVLoader.ini -providerURL com.twsystems.property.file.PropertyFileInterface -CSVFilename "P:\My Documents\CSVSwapLoad.csv"

The problem is I'm running from a directory that is not in the path with the ../.. directory for the jar files.

Is there a way to change the directory of the executing vba code to put it in the same path as the jar files, so the code will recognize the ../.. directory paths?

Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: Chi Happens
Date: September 22, 2003 at 20:00:53 Pacific
Reply:

Use ShellExecute you can specify what directory to start in:

ShellExecute Handle, "OPEN", "your.bat", "", "c:\the path", SW_SHOW

This is a Win32 API function call, you you need to include the declaration by selecting ADD-INS/API Viewer

Chi Happens


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Executing Java program from VBA

Read MS Access using Java program www.computing.net/answers/programming/read-ms-access-using-java-program/3986.html

need help w/ java programming www.computing.net/answers/programming/need-help-w-java-programming/9632.html

How to Create an exe file for java www.computing.net/answers/programming/how-to-create-an-exe-file-for-java/6195.html