Jump to content
Macro Express Forums

Macro Hanging, how to tell where


SteveR
 Share

Recommended Posts

I am having a reliability problem with a macro. It will run anywhere from a few to several hundred times okay, then it will stop. I assume it is at one of my wait for commands, but how can I tell where it has stopped? That would be a big help in understanding what I need to fix.

Link to comment
Share on other sites

One approach would be to scatter commands "Log Message to Default Error Log" at a few (or many) key spots in the macro. Start by putting them just before the "wait for" situations that you suspect. Just number the messages sequentially. Then after a failure you can review the log and see what was the last message logged and that should put you close to the problem spot.

 

I have used log messages extensively for debugging and the macros still ran very fast. Generally I would have a "trace" switch I could turn on and off, stored in an environment variable, and the macros would bypass logging when the switch was off. For your one-time search for this problem, you don't have to get that fancy.

Link to comment
Share on other sites

Attached is the macro I am working with. There are a number of waits which are indefinite. When the macro "fails" it is stopped somewhere I assume on a wait. I can abort the macro with the hotkey. Most of the time at present, the screen shows the open file window. The macro has a wait for this window, I do not know if it is waiting or has gone past it (perhaps the application ignoring the text the macro types) or exactly what is happening.

Upg.mex

Link to comment
Share on other sites

I changed all of the indefinite waits to time out after 30 seconds. This seems to give me meaningful error messages so I can chase down the problem. I guess I was confused and thought the macro would continue after a wait timeout. Having it abort and provide appropriate message is great.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...