View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
clara clara is offline
external usenet poster
 
Posts: 252
Default How to knwo the current statement

Hi Rob,

i like your second method better because it is at least a semi-automatic way.
I read your Professional Excel Development book, in Chaper 16 VBA Debugging
on page 553, you wrote"Having a clear marker on the line of code that will be
executed next tends to be much more valuable than having a marker on the line
of code you just executed. The latter is easily determinded from the former,
but not necessarily vice versa"
Could you explain it again here?

Clara
--
thank you so much for your help


"Rob Bovey" wrote:

"clara" wrote in message
...
Sometimes, application breaks at an execution point and this execution
point
is the next statement, so how can I find the just previously executed
statement? This may sound obviating in a sequence execution case, but what
about in blocks of IF ...ELSEIF case?


Hi Clara,

There's no automatic way to figure this out that I'm aware of. You can
do one of two things. The simplest and most reliable would be to place a
break point before the whole block of code that you are interested in and
then step through it manually to determine which path the code takes.

The other option is to examine the values of all the relevant control
variables and expressions while still in break mode and use that to infer
which path the code took to get where it currently is. The problem with this
method is that it's quite possible for your code to change the state of
these variables and expressions such that it's no longer possible to
reliably determine the previous execution path.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm