Brad2007


How to know if the appactivate has activated a window or if it has not....


Re: appactivate error

Shasur


You can try using the error handling functions

Code Snippet

Sub Activate_App()

' Open NotePad using VBA AppActivate

Dim MyAppID

MyAppID = Shell("NotePad.exe", vbMaximizedFocus) ' Run Microsoft Word.

On Error GoTo Err_In_Activate

AppActivate MyAppID

Err_In_Activate:
If Err <> 0 Then
MsgBox "Error in Activating Window"
End If

End Sub

If the application is not available then it would throw an error

Regards

Shasur