Odd behaviour - running program without clicking on code

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,918
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I have recently come across a program whereby if I merely hover the mouse over a particular line of code, the program runs.

Has anyone come across such odd behaviour?
 
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.
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
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
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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!
 
Upvote 0
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.
 
Upvote 0
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!
 
Upvote 0

Forum statistics

Threads
1,223,646
Messages
6,173,536
Members
452,520
Latest member
Pingaware

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top