appactivate

geoffcodd

Registered User.
Local time
Today, 11:23
Joined
Aug 25, 2002
Messages
87
Hi there,

I am trying to activate the internet exporer window with no luck.

Does anyone know the correct code for doing this.

Thanks
Geoff
 
This code will test if the calculator is already open, if true it will set the focus to it, if false then it will open the calc.exe program. Modify it for the IE window.
Code:
Public Function OpenCalculator_Click()
On Error GoTo Err_OpenCalculator_Click
    
    AppActivate "Calculator", False 'Programs Title Bar Name
    
Exit_OpenCalculator_Click:
    Exit Function
    
Err_OpenCalculator_Click:
    If Err.Number = 5 Then 'Invalid procedure call or argument
        Call Shell("C:\Windows\System32\calc.exe", vbNormalFocus)
    Else
        MsgBox Err.Number & " - " & Err.Description
        Resume Exit_OpenCalculator_Click
    End If
    
End Function
 
Thanks for that,

I have been using this but can't work out what to replace "Calculator" with

Any ideas?

Thanks
Geoff
 
AppActivate "Calculator", False 'Programs Title Bar Name
You need to use the name of the program. Look in the upper left corner of your browser window. That is what you need to use. If it is not constant they you might not be able to use the AppActivate.
 
ghudson said:
...Look in the upper left corner of your browser window...


:D :D Mine says "Access World Forums - Reply to Topic - Mozilla Firefox" :D
 

Users who are viewing this thread

Back
Top Bottom