Solved

How do I execute a Java com from a VB app?

Posted on 2004-09-28
4
135 Views
Last Modified: 2013-11-25
I have a Java com that I want to run from a VB application.  

How do I execute a Java com from a VB app?  Please show example...
0
Comment
Question by:seckel
4 Comments
 
LVL 26

Expert Comment

by:EDDYKT
Comment Utility
0
 
LVL 16

Expert Comment

by:JohnBPrice
Comment Utility
Java Application?  Not Java Applet?  Just use shell with the appropriate command line, e.g. "Java MyJavaApp" with whatever parameters & switches you need.
0
 

Author Comment

by:seckel
Comment Utility
I need to know how to execute a Java component (not a application or applet).  
0
 
LVL 15

Accepted Solution

by:
babuno5 earned 500 total points
Comment Utility
well here is a sort of a demonstration to run any application or a  runtime component


Shell:  This is a very useful key word.  By use of the shell command, you can start other programs.  Look at this example:

Private lshell as long

Lshell = shell(“c:\path\name.exe”,1)

This tells the computer to take the path name and start the program “name.exe” in standard mode (1) and return its windows handle to the variable entitled lShell.

      Tip: You must use a long in 32 bit operating systems like Windows 95, 98, or NT because they return a long windows handle.  Windows 3.1 was 16 bit and returned an integer handle.


App.Activate:  This statement allows you to activate a program that is already running.  You can either, activate a program by using its name as it appears in the tool bar or by using the windows handle returned to lShell.

App.activate lshell

     Or

App.activate “MS Word”



Sendkeys:  After app.activate you can send keystrokes to a program.  For example if you have activated the notepad.exe you can then

Sendkeys “My Dog Has Fleas”

And that phrase will appear in the notepad!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

763 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

10 Experts available now in Live!

Get 1:1 Help Now