It is entirely possible that, when you go to click on that button, it is not visible on screen yet. Depends a lot on the forms and such. You might want to expirment with, in your assignment of w4, utilizing a WaitWindow call to make sure that the w4 window exists and is fully loaded before you go on to click the button.
In addition, I'd suggest looking into compiling your application as an open application. You'll have much easier access to the program components and you'll be able to do more detection of components and properties to better control your script flow.
Automated Testing Evangelists
Definition expert - noun - Unknown drip under pressure