cristianbuse / VBA-UserForm-MouseScroll

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

Cannot debug with Office 365 #15

Closed n07cn3 closed 2 years ago

n07cn3 commented 2 years ago

Hello

Do you have any other report about this issue?

I just had Office 365 installed on my computer and now every time I try to debug the excel just close out.

This also happen with your demo file I downloaded.

Can you please fix this?

I really like this code.

Thank you,

Calvin

cristianbuse commented 2 years ago

@n07cn3

Hi Calvin,

Thanks for raising the issue. Indeed something changed lately and the hook stopped working properly. You are the first to notice the issue.

I just pushed a workaround to the repository. Could you please check if it works and solves your problem?

Cheers, Cristian

n07cn3 commented 2 years ago

Cristian, thank you for looking into this. i've download the latest copy and it also crashed while debug.

my work around for now is to disable the function while in debug and enable it back after i am done.

thanks again for looking into this.

Calvin

cristianbuse commented 2 years ago

@n07cn3

Thanks Calvin!

It seems that the issue I found is a separate thing which had to be fixed anyway.

In the code module there is a note at the top:

Do not debug code while the hook is active to avoid crashes!

I wrote that a long time ago, since the initial version. That's because I was never able to debug while on 64-bit Office. So, it seems you not only upgraded to Office 365 but also to 64-bit version of Office.

There is no way around the issue when using hooks. I would have to rewrite the code to use a timer or a loop to peek at mouse messages but I won't do that any time soon.

Thanks again!

n07cn3 commented 2 years ago

thank you for looking into this.

cristianbuse commented 11 months ago

Starting 76a384fb50d5bb2a5f6de49e287fe2fb774472d6 both Modal and Modeless forms are supported while debugging also works.