Closed RFM-work closed 2 years ago
I think the capabilities of the demo are impressive. I have found a simpler solution that will be easier to maintain over the long term so I will close this issue.
Hi,
The Attribute
keyword is only part of the text file - in your case in the .cls
file. But those get hidden when you import the code module in VBA. I presume you did a copy-paste instead which will paste the extra attributes.
I selected all text & pasted, instead of an import. Thanks for following up. Good work on your part.
From: Cristian Buse @.> Sent: Tuesday, February 15, 2022 11:15 AM To: cristianbuse/VBA-UserForm-MouseScroll @.> Cc: Randy Meinert @.>; State change @.> Subject: Re: [cristianbuse/VBA-UserForm-MouseScroll] Excel 365 issues with the class module (Issue #12)
Caution:This email originated from outside of AZZ. Do not click links or open attachments unless you recognize the sender and know the content is safe.
Hi,
The Attribute keyword is only part of the text file - in your case in the .cls file. But those get hidden when you import the code module in VBA. I presume you did a copy-paste instead which will paste the extra attributes.
— Reply to this email directly, view it on GitHubhttps://github.com/cristianbuse/VBA-UserForm-MouseScroll/issues/12#issuecomment-1040472428, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXY7P7LWTR4UYCFFRWE2XFLU3J3Y5ANCNFSM5OOZC5PA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you modified the open/close state.Message ID: @.**@.>>
CONFIDENTIALITY NOTICE This message and any attachments are confidential and only for addressed recipients. If you are not the intended recipient; printing, retaining, reproducing, disclosing or using any information contained is prohibited. If you received this in error, please contact the sender immediately and destroy the message and any attachments or copies (electronic or hard copy). This e-mail shall not be considered a legally binding agreement or amendment to any agreement.
No problem. Regarding your earlier mention about a simpler solution that is easier to maintain, I would love to hear back from you and understand what makes that easier to maintain. I've tried to make my solution as easy to use as possible (i.e. by calling a single line of code - EnableMouseScroll
) but I would be glad to improve further if you have any ideas or found something that you liked somewhere else. Thanks!
First let me say that your solution is comprehensive and well done. Here’s my situation: I’m writing code to facilitate the creation of expense reports as a quasi-contractor for a firm. I’m not a full-time IT employee for the firm; I have other duties, but it happens that in a past life I did a bunch of VB coding. I need to be cognizant to maintain complexity of whatever I deliver at the lowest level possible, because I won’t always be available to troubleshoot issues. Simpler = more stable in my mind.
I began searching for a solution to the scrolling issue with comboboxes only because when people begin using this version, they might come to me asking why their mouse doesn’t work to scroll. After I run through testing my own stuff, I’ll either decide to incorporate code to address the mouse/combobox issue or tell them to “live with it”, depending on my evaluation
I found an alternate solution from this fellow:
' Jaafar Tribak @ MrExcel.com on 22/04/20 (updated on 18/08/2020) ' Code that enables mousewheel scrolling in vba Userform ComboBoxes.
From: Cristian Buse @.> Sent: Wednesday, February 16, 2022 3:25 AM To: cristianbuse/VBA-UserForm-MouseScroll @.> Cc: Randy Meinert @.>; State change @.> Subject: Re: [cristianbuse/VBA-UserForm-MouseScroll] Excel 365 issues with the class module (Issue #12)
Caution:This email originated from outside of AZZ. Do not click links or open attachments unless you recognize the sender and know the content is safe.
No problem. Regarding your earlier mention about a simpler solution that is easier to maintain, I would love to hear back from you and understand what makes that easier to maintain. I've tried to make my solution as easy to use as possible (i.e. by calling a single line of code - EnableMouseScroll) but I would be glad to improve further if you have any ideas or found something that you liked somewhere else. Thanks!
— Reply to this email directly, view it on GitHubhttps://github.com/cristianbuse/VBA-UserForm-MouseScroll/issues/12#issuecomment-1041233138, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXY7P7NPBSBT4MOMIH7EA7LU3NNPFANCNFSM5OOZC5PA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you modified the open/close state.Message ID: @.***>
CONFIDENTIALITY NOTICE This message and any attachments are confidential and only for addressed recipients. If you are not the intended recipient; printing, retaining, reproducing, disclosing or using any information contained is prohibited. If you received this in error, please contact the sender immediately and destroy the message and any attachments or copies (electronic or hard copy). This e-mail shall not be considered a legally binding agreement or amendment to any agreement.
Oh yeah, I know this one. If you only want to use scroll for combo boxes then I suggest you go with Jaafar's solution. His solution does not involve a hook like mine does and so it cannot crash the host application. My solution can crash the application in rare cases. I did add a lot of extra checks to make sure it doesn't but it's just the nature of using hooks in VBA. Good luck and thanks for the kind words!
Starting 76a384fb50d5bb2a5f6de49e287fe2fb774472d6 both Modal and Modeless forms are supported while debugging also works. Crashes do not occur anymore unless 'Reset; (IDE button) is pressed on purpose and only while stepping through code in the scope of MouseProc
only. So, highly unlikey to crash
The mousescroll capability is very useful. After seeing the demo workbook, I'm trying to use your code in a test Excel workbook with 1 userform. I will only be using this with a native Excel 365 workbook & its native controls--specifically comboboxes.
Every line below that starts with the word Attribute is highlighted in red in my VB code Editor
How can i resolve this? Thank you.