"WaitWindowOpen>Microsoft Excel" is hanging

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
sue
Newbie
Posts: 8
Joined: Sat Jul 29, 2006 2:56 pm
Location: Cape Coral

"WaitWindowOpen>Microsoft Excel" is hanging

Post by sue » Mon Apr 30, 2007 10:41 am

Hi:
I downloaded your trail software about a year ago ... and never finished my project... I wanted to finish it - and re-downloaded the trail version. But the parts of the scrip which where working back then are not working anymore ...?

The "WaitWindowOpen>Microsoft Excel" is just hanging.
Here is the sample code... I got rid of the rest for now (it is displaing "test1" but not "test2")

MouseMove>0,0
Let>delay=1
Let>ExcelWaitTime=0.05
Let>filename=%SCRIPT_DIR%\test.xls
IfFileExists>filename
ExecuteFile>filename
MessageModal>test1
WaitWindowOpen>Microsoft Excel -*
MessageModal>test2
Send>**********START******************************
Press Enter * 1
Wait>ExcelWaitTime
Label>end_script

Any help would be highly appreciated.
Thanks,
Susanne

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

Post by Marcus Tettmar » Mon Apr 30, 2007 10:52 am

Works ok for me, although you have an Endif missing. My script is:

Code: Select all

MouseMove>0,0
Let>delay=1
Let>ExcelWaitTime=0.05
Let>filename=%SCRIPT_DIR%\test.xls
IfFileExists>filename
  ExecuteFile>filename
  MessageModal>test1
  WaitWindowOpen>Microsoft Excel -*
  MessageModal>test2
  Send>**********START******************************
  Press Enter * 1
  Wait>ExcelWaitTime
Endif
Label>end_script
This works for me. But which version of MS Excel do you have?

WaitWindowOpen doesn't "hang". As it's name suggests it *waits* until the window specified opens. If that window never opens or is never found, then WaitWindowOpen will wait forever. So if it appears to be "hanging" this means that the window title specified is not being found.

Which version of Excel do you have? Also are you running the latest version of Macro Scheduler (9.1)?

BTW - one problem with your script is that after Excel opens you then have the line MessageModal>test2. This will cause focus to be removed from Excel and back to Macro Scheduler. Therefore the subsequent Send and Press Enter commands will cause keystrokes to land on Macro Scheduler. Either remove the MessageModal line or insert a SetFocus line after it to ensure Excel is focused for the keystrokes.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

sue
Newbie
Posts: 8
Joined: Sat Jul 29, 2006 2:56 pm
Location: Cape Coral

Post by sue » Mon Apr 30, 2007 11:06 am

Thanks for your fast response!

The excel file is opening fine - but then the sript is just "hanging"
... that's why I tried to add Message-2 to see where it is "hanging"...

I have MS Excel 2003 (11.8120.8122) SP2.
Macro Scheduler: Version 9.0.054e (eval) / April 2007

I tied your script ... but the same result...

Thanks,
Susanne

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

Post by Marcus Tettmar » Mon Apr 30, 2007 11:13 am

Run this:

Code: Select all

MouseMove>0,0
Let>delay=1
Let>ExcelWaitTime=0.05
Let>filename=%SCRIPT_DIR%\test.xls
IfFileExists>filename
  ExecuteFile>filename
  Wait>10
  GetActiveWindow>title,X,Y
  MessageModal>title
Endif
Run the script, wait 10 seconds for the message window - do not click the mouse or press any keys in this time. Tell us what the message is in the message window.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

sue
Newbie
Posts: 8
Joined: Sat Jul 29, 2006 2:56 pm
Location: Cape Coral

Post by sue » Mon Apr 30, 2007 11:25 am

The Message box says:

Microsoft Excel

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

Post by Marcus Tettmar » Mon Apr 30, 2007 12:03 pm

Ok, so your script needs to be:

Code: Select all

MouseMove>0,0
Let>delay=1
Let>ExcelWaitTime=0.05
Let>filename=%SCRIPT_DIR%\test.xls
IfFileExists>filename
  ExecuteFile>filename
  MessageModal>test1
  WaitWindowOpen>Microsoft Excel*
  MessageModal>test2
  SetFocus>Microsoft Excel*
  Send>**********START******************************
  Press Enter * 1
  Wait>ExcelWaitTime
Endif
Label>end_script
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

sue
Newbie
Posts: 8
Joined: Sat Jul 29, 2006 2:56 pm
Location: Cape Coral

THANKS !!!

Post by sue » Mon Apr 30, 2007 12:16 pm

Thanks a Lot,
that's it!
Susanne

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