Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
execute a .exe file and type a text string by vba on it
Hi all,
I have a software ending with .exe that i would like to open, type the word 'select' on it, press 'enter' and make it run from excel. I used the following code but vba doesn't recognize 'wd' as an application but as a number. Dim wd As Application wd = Shell("Y:\--\Sel.exe", 1) Application.SendKeys "select" Do you have any clues about? Thanks, Marco |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
execute a .exe file and type a text string by vba on it
Marco,
Check the help for the Shell function. You will see that it returns a Variant (Double), which is the PID. In Excel VBA, "Application" will refer to Excel application, not just any application. Also, you can use vbNormalFocus in place of 1 for clarity. Note that there are 2 versions of SendKeys: Application.SendKeys VBA.SendKeys The first is Excel's, the second VBA's. Whilst it may not matter in your case, I have read there are subtle differences between the 2. I assume you have checked that there is no better way of interacting with this exe ? Command line, DDE, automation ? NickHK "Marco" wrote in message oups.com... Hi all, I have a software ending with .exe that i would like to open, type the word 'select' on it, press 'enter' and make it run from excel. I used the following code but vba doesn't recognize 'wd' as an application but as a number. Dim wd As Application wd = Shell("Y:\--\Sel.exe", 1) Application.SendKeys "select" Do you have any clues about? Thanks, Marco |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do you save an excel file to be read as IBM-type text file ? | Excel Worksheet Functions | |||
Run/Execute string expression | Excel Programming | |||
Evaluate and execute a string | Excel Programming | |||
Hyperlink - execute a "Back/Previous" type of functionality | Excel Discussion (Misc queries) | |||
Changing a specific character type in text string | Excel Discussion (Misc queries) |