Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Drop Down List with Step by Step Instructions for 2007 remarkable Excel Worksheet Functions 2 March 22nd 09 04:36 AM
Locking debug mode in a macro Megadrone Excel Worksheet Functions 1 November 30th 06 10:32 PM
What is the step-by-step procedure for making a data list? Bobgolfs56 Excel Discussion (Misc queries) 1 April 23rd 05 02:19 PM
I need step by step instructions to create a macro for 10 imbedde. diana Excel Worksheet Functions 3 January 31st 05 01:56 AM
Mysterious debug mode Shunt Excel Programming 0 August 7th 03 02:35 PM


All times are GMT +1. The time now is 03:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"