Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Debug Step vs Run Mode
SubB is called from SubA. My problem is the return to SubA
seems to occur prematurely - before executing all the code in SubB. I cannot see anything in SubA or SubB to cause this. I placed a messagebox as the last line of code in SubB just to see if it was getting there. Sure enough - no Messagebox pops up in runtime. Aha, now I'm on to something, right? To debug it further, I placed a breakpoint at Call SubB, and stepped the rest of the way through SubB. Here's what happens - EVERY LINE of SubB code executes in step mode, right up through the messagebox. Honest! I'm baffled. Any ideas? Art |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Debug Step vs Run Mode
Arthur,
Do you have any error handling that causes it to bypass code? Post the code and give details. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Arthur" wrote in message ... SubB is called from SubA. My problem is the return to SubA seems to occur prematurely - before executing all the code in SubB. I cannot see anything in SubA or SubB to cause this. I placed a messagebox as the last line of code in SubB just to see if it was getting there. Sure enough - no Messagebox pops up in runtime. Aha, now I'm on to something, right? To debug it further, I placed a breakpoint at Call SubB, and stepped the rest of the way through SubB. Here's what happens - EVERY LINE of SubB code executes in step mode, right up through the messagebox. Honest! I'm baffled. Any ideas? Art |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Debug Step vs Run Mode
Bob, there is no error handling. The code is rather
lengthy to post. I'll have to see if I can pull out the relevant pieces. Thanks for your interest. Have you ever encountered a situation that behaved differently in runtime vs. step mode? Art -----Original Message----- Arthur, Do you have any error handling that causes it to bypass code? Post the code and give details. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Arthur" wrote in message ... SubB is called from SubA. My problem is the return to SubA seems to occur prematurely - before executing all the code in SubB. I cannot see anything in SubA or SubB to cause this. I placed a messagebox as the last line of code in SubB just to see if it was getting there. Sure enough - no Messagebox pops up in runtime. Aha, now I'm on to something, right? To debug it further, I placed a breakpoint at Call SubB, and stepped the rest of the way through SubB. Here's what happens - EVERY LINE of SubB code executes in step mode, right up through the messagebox. Honest! I'm baffled. Any ideas? Art . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Debug Step vs Run Mode
Yes, especially if the code is in a sheet level module.
This duplicates the kind of behavior you describe: Sub SubA() On Error Resume Next vval = 1 vval = 2 subb vval = 4 vval = 5 MsgBox "end of suba" End Sub Sub subb() vval = 1 vval = 2 vval = 3 / 0 MsgBox "end of subb" End Sub You may say you don't use error handling, bug do you have on error resume next? Do you use if condition then exit sub actual execution versus step mode can cause things to be evaluated differently if the code depends on the environment. -- Regards, Tom Ogilvy Arthur wrote in message ... Bob, there is no error handling. The code is rather lengthy to post. I'll have to see if I can pull out the relevant pieces. Thanks for your interest. Have you ever encountered a situation that behaved differently in runtime vs. step mode? Art -----Original Message----- Arthur, Do you have any error handling that causes it to bypass code? Post the code and give details. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Arthur" wrote in message ... SubB is called from SubA. My problem is the return to SubA seems to occur prematurely - before executing all the code in SubB. I cannot see anything in SubA or SubB to cause this. I placed a messagebox as the last line of code in SubB just to see if it was getting there. Sure enough - no Messagebox pops up in runtime. Aha, now I'm on to something, right? To debug it further, I placed a breakpoint at Call SubB, and stepped the rest of the way through SubB. Here's what happens - EVERY LINE of SubB code executes in step mode, right up through the messagebox. Honest! I'm baffled. Any ideas? Art . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating a Drop Down List with Step by Step Instructions for 2007 | Excel Worksheet Functions | |||
Locking debug mode in a macro | Excel Worksheet Functions | |||
What is the step-by-step procedure for making a data list? | Excel Discussion (Misc queries) | |||
I need step by step instructions to create a macro for 10 imbedde. | Excel Worksheet Functions | |||
Mysterious debug mode | Excel Programming |