Odd behaviour - running program without clicking on code

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,207
How would you expect it to show you the value of the property without executing the code?
I don't understand your question.

The problem I've discovered with the code I've posted is when you run the program, it hits the breakpoint, as expected.

But what is strange is if you hovered the mouse over a particular line of code (without clicking it), the program continues to run.
 

Some videos you may like

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,697
Office Version
2010
Platform
Windows
And the word "mouse" is not found in the code. The code doesn't contain any mouse-related event.

How can mouse hovering make the code resume running? Perhaps a secret backdoor planted by MS?;):rolleyes:o_O
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
35,114
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
If you hover close enough to the property call, the IDE will attempt to show you its value in a tooltip. In order to do that, it will have to run the code.
 

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,697
Office Version
2010
Platform
Windows
This is the situation:

code.png


Letter.IfTooManyGoes is False and the code is on break. If I move the mouse over Letter.IfTooManyGoes, the code would resume running. However, it doesn't continue on to "Exit Sub" as it would if it continues from the break point. I put a break point on the next four lines, I randomly put break points in all three class modules and the one standard module, none catches the running code. I even put a break point on the first line of code in the standard module. It still doesn't catch. The game just starts all over, escaping all the break points I add.
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
35,114
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
If you hover over that, the IDE has to run the code for that property to show you the value. It will not simply show you the value returned previously.
 

pjmorris

Well-known Member
Joined
Aug 2, 2012
Messages
1,903
Office Version
2016
Platform
Windows
Apologies for butting in,

Rory are you saying that the IDE will run Class Code if it comes across a variable that is defined in a Class Module? (I've never used a class in Excel, but think I know a little about the structure - could very well be completely wrong).

My experience with Non Class VBA (normal, easy stuff) is that the IDE only reports the current value of a variable as is held internally at the time the Break halts execution. It doesn't run the code to calculate new figures.
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
35,114
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
If you hover over a property (whether in a class or normal module), it has to run the code to get the value. It’s not like hovering over a stored variable.
 

pjmorris

Well-known Member
Joined
Aug 2, 2012
Messages
1,903
Office Version
2016
Platform
Windows
I understand the point, but surely it shouldn’t cause it to step away from the point at which the code has stopped. I’ve never seen/recognised that happening - surely the issue faced by the OP would be much more common if it ran the code in the sense that I understand the term. I’m confused - we’ll have to play with his code I think!
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
35,114
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
It shouldn’t run anything other than the property procedure. You can test more simply by just using a property procedure defined in a normal module.
 

pjmorris

Well-known Member
Joined
Aug 2, 2012
Messages
1,903
Office Version
2016
Platform
Windows
Rory, can you clarify what you mean by a 'property procedure', its not a term I'm familiar with and don't want to guess!
 

Watch MrExcel Video

Forum statistics

Threads
1,102,110
Messages
5,484,812
Members
407,467
Latest member
spurs50

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top