PotterHarry Posted June 25, 2010 Report Share Posted June 25, 2010 Hi there, I am running a macro which opens a web page and scans for certain colours, which will prompt actions further down the macro. I wanted to test this by leaving it running all day, and getting it to check the page every ten minutes or so. I set up a repeat, until loop. Within this section there is a Run Macro "Web". It won't work. It runs through it once and then stops. I substituted Run Macro "Web" with Run Macro "Beep" (A short macro which beeps to indicate it has occured), and that works fine every time. I checked to make sure I am not using the same conflicting variables, and I am wondering... the Web Macro in turn calls other short macros. Is there a possibility that this is the reason for its failure? Thank you. Quote Link to comment Share on other sites More sharing options...
rberq Posted June 26, 2010 Report Share Posted June 26, 2010 Does macro "Web" end with a Macro Stop command? It should end with Macro Return if it is called from another macro. Quote Link to comment Share on other sites More sharing options...
PotterHarry Posted June 26, 2010 Author Report Share Posted June 26, 2010 Thanks, rberq. It didn't but now it does! I have put Macro Stop commands at the end of all the sub-macros. Problem persists. I know the culprit - it is some lines within macro "web". I am selectively disabling lines within it, and it runs with blocks of lines disabled. An odd thing happens. As the macro is running, I see macro express maximised, and then ME closes down, locking the XP desktop. ME disappears from the taskbar, and I have to re-launch it. Quote Link to comment Share on other sites More sharing options...
rberq Posted June 26, 2010 Report Share Posted June 26, 2010 Oops. I should have been more direct. Sub-macros should end with Macro Return, not with Macro Stop. At least that's the way it works for me. If I do Macro Run several times, and the sub-macro has a Macro Stop, then the whole process stops after the first execution of the sub-macro -- which matches your original symptoms. Quote Link to comment Share on other sites More sharing options...
acantor Posted June 26, 2010 Report Share Posted June 26, 2010 Thanks, rberq. It didn't but now it does! I have put Macro Stop commands at the end of all the sub-macros. Problem persists. I know the culprit - it is some lines within macro "web". I am selectively disabling lines within it, and it runs with blocks of lines disabled. An odd thing happens. As the macro is running, I see macro express maximised, and then ME closes down, locking the XP desktop. ME disappears from the taskbar, and I have to re-launch it. If there is a "Macro Stop" at the end of your subroutines, I believe that the main macro that calls these subroutines will also stop. But it sounds like there are other bugs, given your description of how your script is failing. My rule for debugging complex scripts -- and even simple ones that are misbehaving -- is to simplify, simplify, simplify. Ensure that the script does the first action correctly. Test and test and test. Add the next step. Test more. And so on. My experience of developing complex scripts is that there may be many things that cause, or contribute to, each problem. It takes a lot of time and patience to sort things out. Quote Link to comment Share on other sites More sharing options...
PotterHarry Posted June 26, 2010 Author Report Share Posted June 26, 2010 I meant to say macro return ... sorry! I took your advice and divided all the sub-macros into less complex units, and I found the culprit. It was a repeat exit that shouldn't have been there! Thanks for your help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.