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!

OLE,open a .EXE and send alt_D, then close it

Status
Not open for further replies.

winniepough

Programmer
Feb 19, 2002
14
US
I can link or create obj of the xxx.exe. I need to send a series of alt_char's to control the exe. Then when it finishes it often leaves a pop-up in focus that needs to be closed before I can close the original exe. How do I do all this? Thanks
 
I tried this and got absolutely nothing in response, Winniepough, the author

Code:
Private Sub Load_Form()

On Error GoTo ErrorCreating
UpdateDataBase = CreateObjext(XXXXX)   'OLE method to access  XXXXX.exe
vbOLEActivateAuto (3)
SendKeys "%(D)", False  '"ALT + D", DataBase, pulldown menu
SendKeys "%(U)", False  '"ALT + U",Update the database
SendKeys "%(U)", False  '"ALT + U",Selects Internet rather than Dial - Up
   'program Dial-Up later

    While Timer < Now + &quot;00:10.00&quot;  'set up the 10 minute timer
    DoEvents                        'definately should finish in that time
    Wend
    
SendKeys &quot;%{F4}&quot;, True  ' Send ALT+F4 to close  ' will this also close the pop-up???

ErrorCreating:
 If Err.Number = 429 Or Err.Number = 91 Then
        'Unable to start or find SF3rdDev
       If Err.Number = 429 Then Caption = &quot;Unable to Start, TC2000 Not Registered&quot;
       If Err.Number = 91 Then Caption = &quot;Cannot find TC2000 program, Re-Trying&quot;
    Else
        'Other error ?
        Caption = &quot;Error Number  &quot; + Err.Number + &quot;ReTry Number = &quot; + ConnectFailure_Count
    End If   'May not be a problem, other checks later, do NOT put up a MsgBox
    
    ConnectFailure_Count = ConnectFailure_Count + 1  'initialized on entry to zero
If Err.Number = 91 And ConnectFailure_Count < 3 Then
    OpenCloseScheduler  ' Try a top down re-start
End If


End Sub


 
Craigsander in:
Home > Forum Areas > Programmers > Languages > Visual Basic(Microsoft) -Version 5 & 6 Forum
How do i tell if an app is running?
thread222-236844
RE: May have provided the NEXT layer to my unwrapping the onion. I will give it a try.
As I fix one problem, another is uncovered. &quot;You never know what is under the next layer of the onion.&quot;
Adding delay Timer() and DoEvents forces a long fixed delay to prevent encountering the RunT ime error..
Response time is of the essence.


Niv3K in: Home > Forum Areas > Programmers > Languages > Visual Basic(Microsoft) -Version 5 & 6 Forum
Open an EXE, tiny new problem, closing the EXE
thread222-227807
provided the major breakthrough which uncovered the above layer.

Thanks WinniePough
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top