如何让Excel VBA IDE支持鼠标滚轮

--微软office官方文章。对了,csdn的blog好像越来越强大了,可以直接从网页上拷贝图片了。

<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>


Use the following steps to enable support for the scroll wheel in VBA 6.

  1. Download and extract the support files

    The support files you need can be found in the VB6MouseWheel.exe download package. You must download and extract these files in preparation for the next step.

    1. Download the VB6MouseWheel.exe package. This package includes the support files you will need to enable the scroll wheel. VB6 Mouse Wheel Fix.
    2. Run VB6MouseWheel.exe to extract the files in the package. You might see a security warning that asks if you want to run this file. If you see the warning, click Run.
    3. When the VB6 Mouse Wheel Fix dialog box appears, read the End User License Agreement (EULA) and, if you agree to its terms, click Yes to install the package.
    4. When the extractor appears, in the Unzip to folder box, type a folder name or click Browse to select a folder, and then click Unzip.
    5. You should see the message 5 file(s) unzipped successfully. When you see that message, click OK. Click Close to close the extractor.
  2. Top of Page Top of Page

  3. Register the DLL with Windows

    One of the support files that you just extracted is VB6IDEMouseWheelAddin.dll. This file provides the core support needed for using the scroll wheel in VBA 6. You must register the DLL with Windows before it can be used. To do so, take these steps:

    1. On the taskbar, click Start, and then click Run.
    2. In the Open text box, type the following command, where <path> is the path specification for the folder where you unzipped the files. For example, if you unzipped the files to the C:/VBAMouseWheel folder, type regsvr32 c:/VBAMouseWheel/VB6IDEMouseWheelAddin.dll.

       Note   The VB6IDEMouseWheelAddin.dll file should not be moved after it has been registered. If you unzipped the support files to a temporary location, you should copy the VB6IDEMouseWheelAddin.dll file to your Windows folder and then register that copy instead.

      regsvr32 <path>/VB6IDEMouseWheelAddin.dll

    3. Your Run dialog box should look something like this:

      Sample Run dialog box

    4. Click OK.
    5. If the command succeeds, you should see a message similar to the following:

      Confirmation that dll registration succeeded

  4. Top of Page Top of Page

  5. Merge the .reg file with your system registry

    Included among the files you extracted is a file with a .reg extension, VBA Mouse Wheel Fix.reg. This file contains a modification to your system registry that enables support for the scroll wheel via a VBA add-in. To merge the .reg file:

    1. Double-click VBA Mouse Wheel Fix.reg, which will have been unzipped to the folder you specified earlier.
    2. Click Yes when you you are prompted with the message Are you sure you want to add the information in <path>/VBA Mouse Wheel Fix.reg to the registry?.
    3. You should see a confirmation message similar to the following illustration. When you see the message, click OK.

      Confirmation that registry update succeeded

  6. Top of Page Top of Page

  7. Enable the VBA add-in

    After you have completed the preceding steps, all that remains is to enable the VBA add-in so that it is automatically loaded whenever the Visual Basic Editor starts. You need only perform this step once, in any of the Microsoft Office System programs, to enable the scroll wheel in the IDE of all of the Microsoft Office System programs.

    The following list shows the steps for the Microsoft Office System programs: Access 2003, Excel 2003, PowerPoint 2003, and Word 2003. Choose only one of these programs and perform the steps listed in the procedure.

  8. Access 2003, Excel 2003, Word 2003, or PowerPoint 2003

    1. Start either Access, Excel, Word, or PowerPoint.
    2. Open a database (Access), workbook (Excel), document (Word), or presentation (PowerPoint).
    3. On the Tools menu, point to Macro, and then click Visual Basic Editor.
    4. When the Visual Basic Editor appears, on the Add-Ins menu, click Add-In Manager.
    5. In the Add-In Manager dialog, click MouseWheel Fix.
    6. Under Load Behavior, select both the Loaded/Unloaded and Load on Startup check boxes. Both check boxes should have a visible checkmark.

      VBA Add-In Manager dialog box

    7. Click OK.
    8. Close the program.

    Top of Page Top of Page

You’re done! After completing these steps, the next time you open the VBA IDE (the Visual Basic Editor), you should be able to open a module and use the mouse wheel to scroll — whether the fix actually enables this functionality depends, ultimately, on your mouse driver.

Technically speaking, the WM_MOUSEWHEEL message is sent to the window with the focus when you rotate the mouse wheel. Because the VBA 6 environment does not have built-in support for scrolling by using the mouse wheel, these messages are ignored. However, after you install the fix described here, the messages are handled by the code in the VB6IDEMouseWheelAddin.dll file.

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值