You could always make your program sleep a little longer.
Check if a file exists:
Code:
Public Function fileexists(strfilepathandname As String) As Boolean
On Error Resume Next
Dim lngcheck As Long
If InStr(strfilepathandname$, ".") = 0& Then
Let fileexists = False
End If
Let lngcheck& = Len(Dir$(strfilepathandname$))
If lngcheck& = 0& Then
Let fileexists = False
Exit Function
Else
Let fileexists = True
End If
Exit Function
End Function
If fileexists("C:\myfile.txt") Then
'code
Else
Exit Sub
End If
Or if you know the application's caption:
Code:
AppActivate "Program's Caption"
Sendkeys "whatever"