Make Mouse Scroll Wheel Work in VBA Editor (IDE)


This ranks right at the top of annoyances when it comes to working with the VBA IDE – the mouse scroll wheel simply does not work. So if you have more lines of code than can fit into a single screen in the VBA IDE, you end up having to drag the scroll bar to up/down to navigate. Jimmy Peña recently posted this very useful VBA tip on his informative blog that provides the solution to this issue. (Read more about this at microsoft help.)

It took me a bit of a time to get this right especially adding the addin to DLL registry server. Here is a stepwise tutorial on how you can make the mouse scroll wheel work with the VBA IDE:

1. Download the vb6mousewheel.exe from the microsoft site and save to local drive.

2. Once the download is complete, double click on the exe. Click on Ok when the end user agreement message appears.

3. Extract the files to a local folder.
extracting-all-the-files-from-the-vba-mouse-wheel-addin

storing-the-vba-mouse-wheel-addin-files-to-a-temporary-folder

4. Copy the file VB6IDEMouseWheelAddin.dll to a stable location. I used D:\Program Files\Microsoft Office\OFFICE11 which is one of the program folders used by MS-Office and which I am sure I am not likely to delete in a hurry.

5. Now press Win + R (The windows key on the keyboard + r) OR Click “Start” -> “Run”. In the box type “cmd” and press enter.
command-line

6. We will now need to register the the DLL (that we copied to the office folder earlier) with windows. In the command line, move to the folder where the VB6IDEMouseWheelAddin.dll has been copied.

adding-the-vba-mouse-dll-information-from-dos-command

7. When you reach the folder where the file has been copied, enter the following:
regsvr32 VB6IDEMouseWheelAddin.dll

You will get the following message:
how-to-make-vba-mouse-wheel-work

8. We will now add the DLL’s information to the windows registry. Go back the folder where we extracted all the files in point 3 above. Double click on the VBA Mouse Wheel Fix.reg. This will add the information to the windows registry. Click Yes when prompted for “Are you sure that you want to add the information in~” message box. Once you’ve done that you will get the following confirmatory message.
windows-registry-message

9. The only step that needs to be carried out now if to go ahead and add the DLL as an addin the VBA Editor (IDE). Open a blank excel sheet and open the VBA editor. On the menubar, click “Add-Ins” -> “Add-In Manager”.
vba-addin-manager

In the Add-In box that appears, turn on both the “Loaded/Unloaded” and “Load on Startup” checkbox. Press Ok.
adding-the-vba-mouse-add-in-from-the-vba-ide

That’s about it. You code in the VBA Editor (IDE) should now be scrolling properly.how-to-make-the-mouse-scroll-wheel-work-in-vba-ide

This entry was posted in Information Technology. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s