cristianbuse / VBA-UserForm-MouseScroll

Use the Mouse Scroll Wheel to scroll VBA UserForms and Controls
MIT License
71 stars 13 forks source link

Mouse hook opens then closes as soon as the UserForm_initialize() function done #29

Closed NicoR45 closed 1 year ago

NicoR45 commented 1 year ago

Situation : the MouseScroll.bas and MouseOverControl.cls files have been imported into xlam file. This xlam file contains a userform with the "EnableMouseScroll Me" instruction in its UserForm_initialize() function. The xlam is called from an xlsm file.

Problem: when the userform is show, the mouse hook opens then closes as soon as the UserForm_initialize() function finishes executing. Unable to use the mouse wheel although the userform is displayed.

Do you have a solution to get around this problem?

cristianbuse commented 1 year ago

Hi @NicoR45 ,

This library cannot deal with modeless forms, only modal. Maybe this is why it unhooks. Can you please check and confirm? Also, does the scrolling work on the available demo book?

Thanks!

cristianbuse commented 1 year ago

Starting 76a384fb50d5bb2a5f6de49e287fe2fb774472d6 both Modal and Modeless forms are supported