鼠标滚动在动态组合框Excel 2016 64位Windows 10 64位 [英] Mouse Scroll in dynamic combobox Excel 2016 64bit Windows 10 64bit

查看:124
本文介绍了鼠标滚动在动态组合框Excel 2016 64位Windows 10 64位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


您好,我们遇到了问题:


我们遇到了问题:



在办公室我们使用Excel文件宏和其中之一使鼠标滚轮在组合框中。我们将此文件与2003年至2016年的Excel和Excel 2010 64位的许多版本一起使用。在我们使用
Office 2016 64位更新计算机之前,一切都运行良好:鼠标滚轮滚动工作几秒钟,然后应用程序崩溃并重新启动。如果我禁用轮子应用程序使用完美,但我们想使用它。你能帮助我们吗?




这是代码  宏代码



解决方案

很难通过该链接上的代码,但看起来它是根据我几年前发布的方法改编的。然而,它包括一些我不会做的事情,也没有包含一些有助于它更好地工作的东西,比如如果鼠标
没有超过控件那么停止钩子(除非我错过了它)


乍一看x64所需的声明有各种不一致之处,特别是所有指针和句柄都必须声明为LongPtr,也就是简单的if ..> 0然后向上Else down在x64中不能按预期工作,但随系统而变化。
 它对x64中的错误更加敏感,因此所有工作表模块代码中的任何错误都可能导致任何崩溃,但很难在没有源文件和对象的情况下创建。


看起来您在同一时间至少在另一个论坛上发布了相同的问题,可能还有其他人。纠正和测试您的代码需要很长时间,因此最好只在一个地方发布,或者至少链接您的帖子,这样人们
响应不会最终重复其他人可能已在其他地方尝试过的内容


Hello, we've got a problem:

we've got a problem:

In the office we use an Excel file with macros and one of them enables the mouse wheel in the combobox. We used this file with many versions of Excel from 2003 to 2016 and Excel 2010 64-bit. Everything worked perfectly until we have updated the computer with Office 2016 64-bit: the mouse wheel scroll works for a few seconds then inevitably the application crashes and restarts. If I disable the use of the wheel application works perfectly but we would like to use it. Please can you help us?

Here's the code macro code

解决方案

It's hard to go through the code on that link but it looks like it's been adapted from an approach I posted some years ago. However it includes some things I wouldn't and doesn't include some things that help it work better,such as stop the hook if the mouse isn't over the control (unless I missed it)

At a glance there are various inconsistencies with the declarations required for x64, in particular all pointers and handles must be declared as LongPtr, also the simple if ..> 0 Then up Else down doesn't work as expected in x64 but varies with systems.  It's much more sensitive to errors in x64 so any error in all that worksheet module code might contribute to any crash, but hard to create without the source file and objects.

It looks like you posted the same question in at least one other forum at the same time and possibly others. It would take a long time to correct and test your code so it's better to post in one place only, or at the very least link your posts, so people responding do not end up duplicating what others might already have attempted elsewhere.


这篇关于鼠标滚动在动态组合框Excel 2016 64位Windows 10 64位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆