+ Reply to Thread
Results 1 to 5 of 5

How to get value of variable when single stepping through code?

  1. #1
    Chet Shannon
    Guest

    How to get value of variable when single stepping through code?

    I have Office 2003 and am writing some Excel VBA code. My question is how
    do I get the value of a variable to show up when I move the mouse cursor on
    top of
    that variable while single stepping through code? (This is the only way I
    want to do it with the mouse because anything else much slower.)

    Previously this worked and I'm now single stepping through my code to debug
    it and the variables are not displaying their values when I move the mouse
    cursor over them. I know I can add a 'watch' also but this is inconvenient
    to do on-the-fly. Tools / auto data tips is turned on also.

    So it worked before and now it's not doing it. I don't know why. I've
    posted 4 times but no one has any ideas yet. Helllllp... any more ideas on
    getting it working to show the values on 'mouse-over' during single step
    execution mode? Is there a program bug in Excel that someone is aware of?
    (Help MVP's..!)

    Thanks,

    Chet Shannon

  2. #2
    Mark
    Guest

    Re: How to get value of variable when single stepping through code?

    I don't know how to fix that problem, but you could try using the
    immediate window. If you have it open as you debug, you can post
    questions to get variable values. like ?Range("A2") Once you hit the
    enter key the next line will display the value of A2. I know it isn't
    nearly as convienient as the mouse but is is helpful. Hope you find
    your answer.


  3. #3
    Bill_S
    Guest

    RE: How to get value of variable when single stepping through code?

    Chet,
    I am no MVP by a long shot, but I had the same problem as you today and
    here's how I got the value of the variable to appear when I move my cursor
    over it.

    -Open up your code in the VB editor
    -Press F9 where you want your breakpoints
    -Press F5 to run your code
    -When it stops at a breakpoint you put your cursor over a variable to get
    the value
    -Press F5 to resume running your code until the next breakpoint

    Here is the webpage that gave me this information:
    http://pubs.logicalexpressions.com/P...cle.asp?ID=349

    Hope that helps you out,
    Bill

    "Chet Shannon" wrote:

    > I have Office 2003 and am writing some Excel VBA code. My question is how
    > do I get the value of a variable to show up when I move the mouse cursor on
    > top of
    > that variable while single stepping through code? (This is the only way I
    > want to do it with the mouse because anything else much slower.)
    >
    > Previously this worked and I'm now single stepping through my code to debug
    > it and the variables are not displaying their values when I move the mouse
    > cursor over them. I know I can add a 'watch' also but this is inconvenient
    > to do on-the-fly. Tools / auto data tips is turned on also.
    >
    > So it worked before and now it's not doing it. I don't know why. I've
    > posted 4 times but no one has any ideas yet. Helllllp... any more ideas on
    > getting it working to show the values on 'mouse-over' during single step
    > execution mode? Is there a program bug in Excel that someone is aware of?
    > (Help MVP's..!)
    >
    > Thanks,
    >
    > Chet Shannon


  4. #4
    Chip Pearson
    Guest

    Re: How to get value of variable when single stepping through code?

    In the VBA Editor, go to the Tools menu and choose Options, then
    the Editor tab. There, ensure that "Auto Data Tips" is checked.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Chet Shannon" <[email protected]> wrote in
    message
    news:[email protected]...
    >I have Office 2003 and am writing some Excel VBA code. My
    >question is how
    > do I get the value of a variable to show up when I move the
    > mouse cursor on
    > top of
    > that variable while single stepping through code? (This is the
    > only way I
    > want to do it with the mouse because anything else much
    > slower.)
    >
    > Previously this worked and I'm now single stepping through my
    > code to debug
    > it and the variables are not displaying their values when I
    > move the mouse
    > cursor over them. I know I can add a 'watch' also but this is
    > inconvenient
    > to do on-the-fly. Tools / auto data tips is turned on also.
    >
    > So it worked before and now it's not doing it. I don't know
    > why. I've
    > posted 4 times but no one has any ideas yet. Helllllp... any
    > more ideas on
    > getting it working to show the values on 'mouse-over' during
    > single step
    > execution mode? Is there a program bug in Excel that someone
    > is aware of?
    > (Help MVP's..!)
    >
    > Thanks,
    >
    > Chet Shannon




  5. #5
    Wild_Jim
    Guest

    Re: How to get value of variable when single stepping through code?

    Funnily enough I have just posted the same query.

    However I found the reason why this was happening.
    It is nothing to do with your settings, it is not working, because you have
    IE open. Mine doesn't work either, but as soon as I shut down Internet
    Explorer, (even in the middle of debugging some code), hey presto, the
    variables are showing immediately.

    Don't know why, but it works!!

    HTH

    Wild Jim


    "Chip Pearson" <[email protected]> wrote in message
    news:[email protected]...
    > In the VBA Editor, go to the Tools menu and choose Options, then the
    > Editor tab. There, ensure that "Auto Data Tips" is checked.
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    > "Chet Shannon" <[email protected]> wrote in message
    > news:[email protected]...
    >>I have Office 2003 and am writing some Excel VBA code. My question is
    >>how
    >> do I get the value of a variable to show up when I move the mouse cursor
    >> on
    >> top of
    >> that variable while single stepping through code? (This is the only way
    >> I
    >> want to do it with the mouse because anything else much slower.)
    >>
    >> Previously this worked and I'm now single stepping through my code to
    >> debug
    >> it and the variables are not displaying their values when I move the
    >> mouse
    >> cursor over them. I know I can add a 'watch' also but this is
    >> inconvenient
    >> to do on-the-fly. Tools / auto data tips is turned on also.
    >>
    >> So it worked before and now it's not doing it. I don't know why. I've
    >> posted 4 times but no one has any ideas yet. Helllllp... any more ideas
    >> on
    >> getting it working to show the values on 'mouse-over' during single step
    >> execution mode? Is there a program bug in Excel that someone is aware
    >> of?
    >> (Help MVP's..!)
    >>
    >> Thanks,
    >>
    >> Chet Shannon

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1