- Joined
- Aug 16, 2002
- Messages
- 6,081
- Office Version
- 365
- Platform
- Windows
I have a VBA userform with a listbox that I've added scroll code to. Works great on my test machines, but on one machine, after a little time, it debugs.
I use a MouseMove event over the listbox to trigger some code. The code triggers, but when it gets to the line
(just a way to check if the control that triggered the code is the feedlist), it debugs and when I look,
.
At first I thought it was a script that runs on the machine every 2 minutes - it opens a new instance of Excel and does some stuff in the background. So, I disabled the script - but the debug still happened.
There is also another program (non-Excel) that runs on the machine. Admittedly, I have had issues remoting into that machine because of that program. When it updates, it does take control of the machine.
I'm assuming that's what is happening, but I can't figure out why the program would forget what Me is. Or, most importantly, how I can workaround this and reinstate Me.
For now, I've disabled all scroll code - and the workbook works fine on that machine.
One thing I haven't tried is skipping the event if Me = Nothing, in hopes that it will reinstate itself. Anyone know enough about what goes on in the background with events and the Mouse API to give me insight?
I use a MouseMove event over the listbox to trigger some code. The code triggers, but when it gets to the line
VBA Code:
Me.ActiveControl = Me.lb_Feedlist
VBA Code:
Me = Nothing
At first I thought it was a script that runs on the machine every 2 minutes - it opens a new instance of Excel and does some stuff in the background. So, I disabled the script - but the debug still happened.
There is also another program (non-Excel) that runs on the machine. Admittedly, I have had issues remoting into that machine because of that program. When it updates, it does take control of the machine.
I'm assuming that's what is happening, but I can't figure out why the program would forget what Me is. Or, most importantly, how I can workaround this and reinstate Me.
For now, I've disabled all scroll code - and the workbook works fine on that machine.
One thing I haven't tried is skipping the event if Me = Nothing, in hopes that it will reinstate itself. Anyone know enough about what goes on in the background with events and the Mouse API to give me insight?