View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Coleman John Coleman is offline
external usenet poster
 
Posts: 274
Default why stepping thru works differently module vs. worksheet

Strange - I never noticed that before but you seem to be right. You
must be more observant than I. A couple of additional observations:

1) If you step through, hit an error then click ok - the cursor is
still on the line that threw the error - it just isn't highlighted
yellow (at least in my experiment). Thus stepping through seems to be
as informative in both cases with just a stylistic difference.

2) If you click the button and it crashes then you do get the debug
dialogue box. Maybe if stepping through yields a problem and you
really want the debug dialogue box you can exit the IDE and click the
button. Again - this was with my experiment - perhaps it works more
annoyingly with your code.

I suspect you would have to track down someone involved with the
actual coding of Excel's debugger to find why it works this way. My
guess is either just an oversight or maybe programmer A didn't
communicate with programmer B regarding this point and manager C
didn't notice. Since sheet modules are class modules, it is probable
that behind the scenes they are handled fairly differently in the IDE,
so it wouldn't be surprising if different programmers worked on
different parts (I wonder if you create a class module and step
through some code you would get the same behavour).

-John Coleman

On Feb 13, 10:57 am, "Susan" wrote:
when i step thru a code in a module, & it runs into an error, it lets
me choose a button "Debug." then i can go into the code & try several
different things without exiting the code (helpful for a learn-as-you-
go person such as myself).
however, when i step thru a code for an option button_click in a
worksheet, & it runs into an error, it completely kicks me out & won't
let me debug (just get buttons "OK" & "Help"; no "Debug").
neither code has error handling in it (mea culpa).
why is this?
thanks
susan