infinite waiting problem running macro

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
durana
Junior Coder
Posts: 21
Joined: Tue Feb 22, 2005 3:08 pm

infinite waiting problem running macro

Post by durana » Fri May 20, 2005 11:21 am

Hello All,

I have a strange problem. I wrote a macro script which runs msaccess macro's, sending email.

When the ms access macro runs, it will popup a window that something is trying to send an email and afther 5 seconds I can send a "j" to that window and everthing works ok. This task wil run ok for a few times...

But now the strange :? thing is that sometimes the popup window is waiting infinitly, sometimes even hours. When I hit the yes button, the macro script will continue running correctly. The strange thing is that this happens not always at the same period/time, but each time differently.....

When I check the log, I see that there the macro stops, and when I hit the yes button, the macro continues further also.

What can I do to prevend this problem, or do you have other suggestions ??

Thanks in advance
Durana

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri May 20, 2005 2:02 pm

Best way for us to help will be to see a sample of the script and the log where it fails, and an explanation related to that log.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

durana
Junior Coder
Posts: 21
Joined: Tue Feb 22, 2005 3:08 pm

Post by durana » Fri May 20, 2005 2:42 pm

Here is some part of my script:


this is the simple version, I the original script I use a loop ofcourse.

Let>MSaccessmakro=makro1
Gosub>MSaccess aansturing
Let>MSaccessmakro=makro2
Gosub>MSaccess aansturing
Let>MSaccessmakro=makro3
Gosub>MSaccess aansturing
etc.....

SRT>MSaccess aansturing
let>makro=MSaccessmakro
run>C:\Apps\Office97\Office\msaccess.exe W:\Change\Cm_query.mdb /x %makro%
wait>30
Press Alt
Send Character/Text>j 5
SetFocus>Microsoft Access*
wait>5
Press ALT
press F4
Release ALT
GetDate>date
Gettime>time
WriteLn>\\Hktgv032v2\Data\Sus\ALGEMEEN\Maatwerk\DocAgent\6. Projecten\macro scheduler\rapportage.txt,result,%date% - %time% - %makro%
wait>5
End>MSaccess aansturing


The script works most of the time ok, 90% of the time :(

The log, I don't have it yet, becourse it has been overwritten. Now I have to wait till it happens again, then can I give also the logging.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri May 20, 2005 2:46 pm

Here's the problem:

run>C:\Apps\Office97\Office\msaccess.exe W:\Change\Cm_query.mdb /x %makro%
wait>30
Press Alt
Send Character/Text>j Microsoft Access*

2) Add a SetFocus line before the keystrokes:

SetFocus>Microsoft Access*
Press ALT
...
MJT Net Support
[email protected]

durana
Junior Coder
Posts: 21
Joined: Tue Feb 22, 2005 3:08 pm

Post by durana » Fri May 20, 2005 3:04 pm

Thanks,

I have put both lines in the script, lets see if the ghost problem happens again.

Durana

durana
Junior Coder
Posts: 21
Joined: Tue Feb 22, 2005 3:08 pm

Post by durana » Thu Jun 09, 2005 7:49 pm

Thanks,

This one is working for me, the problem doens't appear anymore

Durana

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