Userform mouse scroll

Hi, thank you @Jaafar Tribak! I did exactly as you noted above but unfortunately it still does not work. Same behavior--the caption code is returning the scroll & position data, but nothing scrolls in the form.

Nothing has changed in the project from the version where I successfully used your last mouse code, i.e. all I've done is added the class modules (not used before), replaced the code in the standard module (named "mouse" for me) with your new code, and replaced calls throughout with EnableMouseWheelScroll (had been EnableWheelScroll).

Any other troubleshooting suggestions? thx!
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Upvote 0
Hi @Jaafar Tribak, I went back and tried your version from post 7 Userform mouse scroll, which was before you updated to "remove the scroll event handlers from each userform module and we shall replace them with one single scroll event handler which will be placed in the standard api module." I have Excel 2016 not 2019, but thought I'd give it try. That unfortunately didn't work either. Also, interestingly, I no longer see the caption at the top of the form like I did with the most recent code. Before, I thought it was running, just not working. Now, I'm not sure what it's doing.

Thank you.
 
Upvote 0
Hi @Jaafar Tribak, I went back and tried your version from post 7 Userform mouse scroll, which was before you updated to "remove the scroll event handlers from each userform module and we shall replace them with one single scroll event handler which will be placed in the standard api module." I have Excel 2016 not 2019, but thought I'd give it try. That unfortunately didn't work either. Also, interestingly, I no longer see the caption at the top of the form like I did with the most recent code. Before, I thought it was running, just not working. Now, I'm not sure what it's doing.

Thank you.
Hi TomSHopping

To be honest, I am rather confused as to which code version doesn't work for you. Furthermore, I can only test in excel 2016.
Maybe, the best bet is for you to upload the workbook you are having an issue with so I can see it and hopefully figure out what is happening.

You can upload your mock workbook to some free file sharing site such as Box.com and post a link here.
 
Upvote 0
Hi @Jaafar Tribak , thanks much for the reply. The code I was trying was from your recent post Userform mouse scroll #30 above. I could not get it to work with my workbook. My database application workbook has Combo boxes and List boxes that work with your old code, but not with the new.

This weekend I was able to download your sample workbook on another network and your code with the three sample forms does indeed scroll the forms up/down and left/right. I tried adding some Combo and List boxes and... those don't work in your sample workbook either. I never tested whether my forms would scroll in my workbook as I don't have any scrollbars on the forms; the forms are modal and fixed size. The controls are what I use the scrolling for, especially List boxes with many rows used as subforms.

The old code has some challenges, for example one is that I can no longer tab/alt-tab between controls while the mouse code is enabled. It also lacks of course any improvements you've made and use of the API in the new code. But the Combo & List box controls work at least.

Any other suggestions I should try to get the scrolling working in these controls?

Thanks again.
 
Upvote 0
For those that have this code working, can you please let me know if it works in combo and list boxes? thanks!
 
Upvote 0
Hi Jaafar Tribak,

thank you very much for your work on this code!
I've startet with VBA some weeks ago and want to use your code in a scrollable calendar. The calendar has many command buttons and labels to hide the edges of the command buttons. Some seconds your code works well, but then, by moving the mouse, there's an error occuring, saying "Run Time Error 13, Type Mismatch". (It's a translation, I don't know the english version of this error, I'm from Germany.
Can my many Controls on my Userform be the cause for the error or may it also be my used version of excel (from office 365)?
As you told in your earlier posts, this code works every time with mouseMove, even if the mouse is hovering a control.

The marked line, when the error occurs, is the UserForm_MouseMove - Event.

Does your code ignore invisible labels and command buttons, too?
Does your code have problems with already used MouseMove events, e.g. on my Command-Buttons for a "hover"-effect?
I do NOT use a userform_mousemove event, only for groups of buttons.

Thank you for your answer!

charles
 
Upvote 0
Hi Jaafar Tribak,

thank you very much for your work on this code!
I've startet with VBA some weeks ago and want to use your code in a scrollable calendar. The calendar has many command buttons and labels to hide the edges of the command buttons. Some seconds your code works well, but then, by moving the mouse, there's an error occuring, saying "Run Time Error 13, Type Mismatch". (It's a translation, I don't know the english version of this error, I'm from Germany.
Can my many Controls on my Userform be the cause for the error or may it also be my used version of excel (from office 365)?
As you told in your earlier posts, this code works every time with mouseMove, even if the mouse is hovering a control.

The marked line, when the error occurs, is the UserForm_MouseMove - Event.

Does your code ignore invisible labels and command buttons, too?
Does your code have problems with already used MouseMove events, e.g. on my Command-Buttons for a "hover"-effect?
I do NOT use a userform_mousemove event, only for groups of buttons.

Thank you for your answer!

charles
I have to add, I'm using API-Code for deactivating the title of the userform. And I have continued testing your code know and found out, the error occurs, when hovering the blanc userform itself. While hovering labels or buttons, it works well and gives back all parameters of the pseudo-event.
 
Upvote 0
The code doesn't work in combo or list boxes.

Did you take a look @ this thread for enabling mousewheel scrolling for listboxes and comboxes ?

Thanks @Jaafar Tribak! That explains it then.

No, I hadn't found that thread yet. Thanks for pointing it out.

I'm looking for the best code to use for the list and combo boxes. Most stable, and ideally code that addresses some of the challenges I'm having, e.g. doesn't disable tabbing between controls like the code I'm currently using. In your opinion, is the link above the best list & combobox code you're aware of?

Thanks again.

For reference, I hadn't found that thread, but I have reviewed many others that you and others have contributed to, such as:

Generic MouseWheel Scroll for UserForm and for ALL its Controls !
MouseWheelScrolling ListBoxes & ComboBoxes (In worksheets and UserForms)
Safe MouseWheel Event Hook (Addin)
Scroll through worksheets with mouse wheel
and this one, Userform mouse scroll
 
Upvote 0

Forum statistics

Threads
1,215,072
Messages
6,122,966
Members
449,094
Latest member
Anshu121

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