Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell out to a .jar file? 2

Status
Not open for further replies.

TheKing

Programmer
Feb 25, 2002
151
US
I need to shell out to a .jar (java) file.

I have tried: intStart_Summary = Shell("C:\Program Files\SMARTPss\HateCrime.jar", vbHide) ' Run Jar Executable
and I have tried: Shell ("C:\Program Files\SMARTPss\HateCrime.jar"), (vbNormalNoFocus)

There must be something I am missing.

I know the jar executable works since I can double click on it and it works just fine.

When I try to shell out to it tho I get an invalid procedure error.

Run time error 5

Thanks for any help

T[sup]h[/sup]e[sub]K[/sub]i[sup]n[/sup]g
[pc3]
 

I belive (could be wrong) but since the file you are trying to shell is not an executable but an interpreted file you will recieve the error you are recieving. I think you will need to use the ShellExecute API to accomplish what you want.

Good Luck

 
I believe Shell will only run an executable. Youneed to yuse ShellExecute to open a non-executable file with it's default application.

Declare the ShellExecute in a module:

Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Then in the form use:
X = ShellExecute(me.Hwnd, "Open", ("C:\Program Files\SMARTPss\HateCrime.jar"), 0&, 0&, 3)

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
OH man that makes so much sence. Thanks a lot.

T[sup]h[/sup]e[sub]K[/sub]i[sup]n[/sup]g
[pc3]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top