cristianbuse / VBA-UserForm-MouseScroll

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

Not Working #21

Closed cleitonjohnson closed 1 year ago

cleitonjohnson commented 1 year ago

if copy and paste the code image

if import the file image

cleitonjohnson commented 1 year ago

The VBA UserForm MouseScroll_DEMO run normally. If create new userform in Demo run normally

image

cristianbuse commented 1 year ago

Hi @cleitonjohnson ,

Don't copy paste the code. Clone the repository or dowload the zip file and then import the modules.

cleitonjohnson commented 1 year ago

The file imported from the zip folder works. But interesting that copied from the DEMO file does not work. Which magic has the most inside that imported file there? :-D report5 report6

cristianbuse commented 1 year ago

Hi @cleitonjohnson ,

VB* modules have hidden attributes that you can only see in a text editor. For example the top 9 lines in the class module are clearly visible as text but when you import the module, you won't see them in the IDE. This is unfortunately one of the many issues with the VBA editor. So, copy-paste does not work in this case because you need the special Attribute VB_PredeclaredId = True but when copy-pasting it gets defaulted to False.