unreliable macro sometimes stops at waitwindowopen

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
mikew
Newbie
Posts: 6
Joined: Sun Mar 01, 2009 1:05 pm

unreliable macro sometimes stops at waitwindowopen

Post by mikew » Tue Aug 18, 2009 10:01 pm

Hi,

I'm new to the product and have created a couple of macros that automate the import of a csv file into MS Excel. Most of the time it seems to work fine but every now and again the macro stops at waitwindowopen>save as.

RunProgram>D:\Program Files\Microsoft Office\Office12\EXCEL.EXE D:\FTPRoot\LocalUser\user\price_comparison.csv
WaitWindowOpen>file01.csv*
press ALT
send>f
wait>1
send>f
wait>1
send>x
release ALT
wait>1
Waitwindowopen>Save As
SetFocus>Save As
wait>1
send>D:\DB001\test\file01.xlsx
wait>2
press ENTER

The frustrating thing is that it runs fine when I run the macro manually but when it runs at a scheduled time it often 'hangs' at the waitwindowopen point as if the save as window never appears ?

Any ideas ?
Mike W

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Post by gdyvig » Wed Aug 19, 2009 4:22 am

Hi mikew,

Try:

Waitwindowopen>Save As*
SetFocus>Save As*


Sometimes the window title contains additional text you cannot see.


Also put this at the top of your script:

//Look for visible windows only
Let>WF_TYPE=2


Gale

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Aug 19, 2009 7:22 pm

The frustrating thing is that it runs fine when I run the macro manually but when it runs at a scheduled time it often 'hangs' at the waitwindowopen point as if the save as window never appears ?
Is Windows logged in at the scheduled time? If it is locked or logged out or a screen saver is running then it will not "see" the Save As window because, well, it won't exist.

See:
http://www.mjtnet.com/msfaq17.htm
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts