Jason Gross Posted November 19, 2008 Report Share Posted November 19, 2008 I apologize if this is obvious and something I missed. Is it possible to start a macro from the middle of the script? As I create macros, they fail miserably several times and then I'd like to restart it from where it left off to test the next part. I know you can deactivate parts of the macro, but that's time consuming as I cannot just disable the whole script above where I was. Thanks in advance! Jason Quote Link to comment Share on other sites More sharing options...
johnboy691 Posted November 19, 2008 Report Share Posted November 19, 2008 Jason: Not that I'm aware of...what I do is have the macro I'm designing using the main activiation, say (Alt+2). If I have a problem like you describe I make another macro say (Ctrl+2) then copy the code from the first to the second that I want to test or run. This works well for me and I've built macros with over 57,000 lines of script using this method. The only thing you have to remember is if particluar variables capture infromation previously that you need to populate in different screens, etc. that will run in the second test macro those variables will have to be forced at the beginning of the second macro so the information is there. For example, if I have a macro that copies First and Last name from a spreadsheet...but I want to test how it goes through a different screen or field and it will need to populate the first and last name in that screen, you'd have to put variables at the begining to "force" that information in the variables necessary to do the testing you want. This process has always worked well for me. Good Luck! John Quote Link to comment Share on other sites More sharing options...
rberq Posted November 19, 2008 Report Share Posted November 19, 2008 Another idea: Put a temporary multiple choice menu (Dialog) at the beginning of the macro, and use the result to set a variable like N1=1 or 2 or 3 or ... etc. Or just set the N1 value with a statement at the beginning of the macro, which you change manually as your testing progresses. Then break up your macro into convenient chunks that are only executed based on the value of N1: If N1 >= 1 do first chunk End If If N1 >= 2 do second chunk End If If N1 >= 3 do third chunk End If If N1 >= 4 do fourth chunk End If etc. Quote Link to comment Share on other sites More sharing options...
Jason Gross Posted November 19, 2008 Author Report Share Posted November 19, 2008 Both great ideas, thanks! I've tried the first idea before. I think I'll give the 2nd idea a shot as well to see if it's easier as a long term strategy than the first. Thanks! 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.