I have been sweating this for days mow and I have had enough. If I use this easy sample code to switch windows, the code works no problem:
Private Sub CommandButton1_Click()
AppActivate ("Untitled - Notepad"), True
Wait (3) 'a custom function that delays - works fine so i can see whats going...