Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default why stepping thru works differently module vs. worksheet

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default why stepping thru works differently module vs. worksheet

What are your options in tools=Options in the VBE under the general tab.

Under Error trapping, try clicking "Break in Class Module" rather than
"Break on Unhandled errors"

--
Regards,
Tom Ogilvy


"Susan" wrote in message
oups.com...
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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default why stepping thru works differently module vs. worksheet

john - para. #1 - yes, the line is not highlighted but it's not just a
style difference, it literally ends the code & you can't continue
except to start over from "option explicit".

tom - yes, now i get the "debug" button if i change that option.
but will that work for a regular module, too, or will i have to change
it back to "break on unhandled errors" again? the options are set for
excel as a whole, not per workbook, i believe.
thank you!
susan


On Feb 13, 12:01 pm, "Tom Ogilvy" wrote:
What are your options in tools=Options in the VBE under the general tab.

Under Error trapping, try clicking "Break in Class Module" rather than
"Break on Unhandled errors"

--
Regards,
Tom Ogilvy

"Susan" wrote in message

oups.com...



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- Hide quoted text -


- Show quoted text -



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default why stepping thru works differently module vs. worksheet

Thanks for the info. As usual, your answer goes beyond guess work. It
seems strange that "break on all unhandled errors" doesn't, in fact,
break on all unhandled errors. Is there any thing to watch out for if
you leave "Break on Class Module" as the default?

On Feb 13, 12:01 pm, "Tom Ogilvy" wrote:
What are your options in tools=Options in the VBE under the general tab.

Under Error trapping, try clicking "Break in Class Module" rather than
"Break on Unhandled errors"

--
Regards,
Tom Ogilvy

"Susan" wrote in message

oups.com...



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- Hide quoted text -


- Show quoted text -





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default why stepping thru works differently module vs. worksheet

Yes, the setting is at the "Excel" level.

I don't believe it will change the behavior in a regular module - at least I
have not noticed a problem.

--
Regards,
Tom Ogilvy


"Susan" wrote in message
ups.com...
john - para. #1 - yes, the line is not highlighted but it's not just a
style difference, it literally ends the code & you can't continue
except to start over from "option explicit".

tom - yes, now i get the "debug" button if i change that option.
but will that work for a regular module, too, or will i have to change
it back to "break on unhandled errors" again? the options are set for
excel as a whole, not per workbook, i believe.
thank you!
susan


On Feb 13, 12:01 pm, "Tom Ogilvy" wrote:
What are your options in tools=Options in the VBE under the general tab.

Under Error trapping, try clicking "Break in Class Module" rather than
"Break on Unhandled errors"

--
Regards,
Tom Ogilvy

"Susan" wrote in message

oups.com...



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- Hide quoted text -


- Show quoted text -





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
BreakLinks method works when Stepping Through but not when Running! WhytheQ Excel Programming 2 September 19th 06 02:36 PM
Macro works differently on different computers, same version of Ex oscardwilde Excel Discussion (Misc queries) 6 December 28th 05 11:22 PM
Alt-Tab works differently if Form called from Menu or Buttonbar Icon seisman Excel Programming 5 August 2nd 05 10:36 AM
macro works differently when using the Step Into (F8) feature Dave Y[_4_] Excel Programming 1 June 24th 05 03:06 AM
VBA Code works by stepping through, not by running JbL Excel Programming 7 November 4th 04 02:49 PM


All times are GMT +1. The time now is 02:11 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"