Macro fails when invoked from shortcut

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
delta1
Junior Coder
Posts: 26
Joined: Wed Dec 16, 2009 11:23 pm

Macro fails when invoked from shortcut

Post by delta1 » Thu Jan 14, 2010 10:37 pm

My macro fails when invoked from a desktop shortcut but runs well when invoked from MS. I'm at a loss to understand this. I have insured that I have the exact and latest macro in the shortcut.
It fails about half way through and seems like a timing issue but why does it work when invoked directly from MS?
Rob

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Jan 14, 2010 10:47 pm

What does your macro do?

There are lots of possible issues. The first to come to mind is: are you writing, reading, or calling other files? If so are the names fully pathed? When called from the Macro Scheduler menu, file names are influenced by Macro Scheduler settings. When called from a shortcut, file names are at the mercy of the operating system and the environment path.

delta1
Junior Coder
Posts: 26
Joined: Wed Dec 16, 2009 11:23 pm

Post by delta1 » Thu Jan 14, 2010 11:23 pm

The macro opens and reads some text from a tabbed dbx (via GetTextatPoint).
The macro stops at an error message because a tabbed dbx was not being manipulated properly. Thats why I thought it was a timing issue.

I have now increased STEP_DELAY from 10 to 20 and that seems to have cured the problem, but I don't understand why the macro always worked when invoked from MS.

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Jan 14, 2010 11:35 pm

but I don't understand why the macro always worked when invoked from MS.
Extra overhead probably slowed it down enough to work.

delta1
Junior Coder
Posts: 26
Joined: Wed Dec 16, 2009 11:23 pm

Post by delta1 » Fri Jan 15, 2010 12:06 am

Thanks.
Rob

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