Hi all i am using the following timer to close a massage box whenever it pops up in external application. But i want to call another button command after closing that massage box. I placed the call inside the if statment but it never calls command button. could you guys tell me what might be wrong? Thanks


2 Code:
  1. Private Sub Timer1_Timer()
  2. Dim X As Long, editx As Long
  3. Dim button As Long
  4.  
  5.  X = FindWindow("#32770", "Successful")
  6.    If X Then
  7.  SendMessage X, WM_CLOSE, 0&, 0&
  8. Command2_Click
  9.    End If
  10. End Sub
  11.  
  12. Private Sub Command2_Click()
  13. ......
  14. ......
  15. msgbox " i have been called ";
  16. .....
  17. .....
  18. End sub