akeena_g
asked on
Calling an .exe file in VB
Hello,
We have a Java program called Test that has a textbox on it. The user would enter a path and then press the Enter key. The path will then be used to process other commands in the application.
Now, we converted our Java application into an .exe file. We then want to call this file in a VB application by using Shell. Our syntax goes like this:
a = Shell("Test.exe")
AppActivate a
SendKeys "C:\TestFile.pdf"
SendKeys "{Enter}"
The textbox (in the Java app) receives the focus when the program is loaded. However, the program doesn't work. What do I need to make it work?
Thanks in advance!
We have a Java program called Test that has a textbox on it. The user would enter a path and then press the Enter key. The path will then be used to process other commands in the application.
Now, we converted our Java application into an .exe file. We then want to call this file in a VB application by using Shell. Our syntax goes like this:
a = Shell("Test.exe")
AppActivate a
SendKeys "C:\TestFile.pdf"
SendKeys "{Enter}"
The textbox (in the Java app) receives the focus when the program is loaded. However, the program doesn't work. What do I need to make it work?
Thanks in advance!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
How exactly can I make my exe prog accept a command line argument?
try following
ReturnValue = Shell("NOTEPAD.EXE", 1)
AppActivate ReturnValue
SendKeys "Hello"
SendKeys "{Enter}"
hope it helps,
khaleel
ReturnValue = Shell("NOTEPAD.EXE", 1)
AppActivate ReturnValue
SendKeys "Hello"
SendKeys "{Enter}"
hope it helps,
khaleel
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
a = Shell("Test.exe ""C:\TestFile.pdf""")