View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Marcus Schöneborn Marcus Schöneborn is offline
external usenet poster
 
Posts: 15
Default Different results when running macro vs stepping into macro

»Ken Steinhoff« wrote:
My boss built a macro which returns different results when run than
when he steps through it.

Before I get specific about what the macro does (since I don't have it
in front of me), I thought I'd ask the general question about what
might cause that to happen.

If the macro works when executed manually step-by-step, I would think
it should work the same way when launched.


It may access the current time multiple times:

t1 = time() - value1 ' age of value1
t2 = time() - value2 ' age of value2
dt = t2 - t1 ' age difference

When single stepping, dt can be LARGER than value1 - value2, although
it's equal when running at once.