Closed Thread
Results 1 to 11 of 11

Mouse Scroll Wheel in 64 bit

  1. #1
    Registered User
    Join Date
    01-22-2017
    Location
    Michigan
    MS-Off Ver
    365
    Posts
    61

    Mouse Scroll Wheel in 64 bit

    I've got 32 bit to work flawlessly, but I haven't been able to get 64 bit to work. The problem is that there are so many variations to the code and so it's hard to figure out from the examples how to adjust the code that I'm using. Any help is appreciated! I tried changing the declarations to PtrSafe, but that wasn't enough. I tried changing all of the Long to LongPtr, and it was finally able to run, but not very well- the mouse scroll was all wonky. I just don't know enough about these functions to make all these changes.

    I finally got the chance to upgrade my home computer to 64 bit Excel and I jumped on it!

    I'll include the whole file as an attachment.

    Here's the 32bit code for the mouse (without any changes)

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Soulfien; 10-15-2018 at 12:13 AM.

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Mouse Scroll Wheel in 64 bit

    Perhaps the code here will help:

    https://www.excelforum.com/excel-pro...se-scroll.html
    Rory

  3. #3
    Registered User
    Join Date
    01-22-2017
    Location
    Michigan
    MS-Off Ver
    365
    Posts
    61

    Re: Mouse Scroll Wheel in 64 bit

    Thanks for the reference. I was able to get this code to work, however, this type of scroll wheel function is for very short lists. It works by moving to the next selection rather than moving down the scroll bar itself. This makes for a LOOOOOOOT of scrolling to get through my long lists.

    I'll include the new file for reference. Again, I do appreciate the help. Perhaps I can see how this code works and learn how to adapt my preferred code.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-22-2017
    Location
    Michigan
    MS-Off Ver
    365
    Posts
    61

    Re: Mouse Scroll Wheel in 64 bit

    It works! I adapted my code using the example provided!

    Thank you! I will post the finished product here:
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-04-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    10

    Re: Mouse Scroll Wheel in 64 bit

    Quote Originally Posted by Soulfien View Post
    It works! I adapted my code using the example provided!

    Thank you! I will post the finished product here:
    Thanks for posting your file. I've been wanting a mouse wheel scroll that doesn't select anything and so far this is the best I've seen.

    Is that file CSR 54.xlsm you attached the latest one you had? It works in Windows 10 64 bit/Excel 32 bit, but not Excel 64 bit. When I run on 64 bit, it gives an automation error. There's only one "#If Win64 Then" which is commented out I would assume you would need that in other places as well. I'll review Rory's link to see if I can piece together, but wonder if you had a working file for both 32 & 64.

    Also, for others, here is my code where I tweaked the listbox .topindex property, so it will always scroll to the top (seems if the .topindex is negative it wouldn't go to the top). I also need to figure out a way to use the scroll in a large text box and using curpostion, but haven't gotten to that yet. Need this to work in 32 & 64 bit before adding more features!

    Please Login or Register  to view this content.
    Put this in your userform (I put it at the bottom of my Private Sub UserForm_Initialize() event):
    Please Login or Register  to view this content.
    Be sure to change the iGblControlType to the control type you are using and the "Me.lbTrades" to your listbox (or other control) name.

    Put
    Please Login or Register  to view this content.
    before your unload event or in the form QueryClose event.
    Last edited by mikepfly2; 02-14-2020 at 06:18 PM. Reason: formatting

  6. #6
    Registered User
    Join Date
    08-04-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    10

    Re: Mouse Scroll Wheel in 64 bit

    Ok, so have it working and tested on Windows 10 64bit and Office 16 Excel both 32 bit and 64 bit. Thanks Soulfien and Rorya!
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-04-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    10

    Re: Mouse Scroll Wheel in 64 bit

    Does anyone think it's possible to add scrolling to a text box that is multi-line and has a vertical scrollbar?

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Mouse Scroll Wheel in 64 bit

    Quote Originally Posted by mikepfly2 View Post
    Does anyone think it's possible to add scrolling to a text box that is multi-line and has a vertical scrollbar?
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  9. #9
    Registered User
    Join Date
    08-04-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    10

    Re: Mouse Scroll Wheel in 64 bit

    Sorry for any confusion. The original post was relating to scroll bars on user form elements. The code in the OP included the following elements:
    Please Login or Register  to view this content.
    I was simply trying to see if it would work with textbox control element "nMyControlTypeTEXTBOX" so thought it was relative. I'll open a new thread but it will contain the same code as my reply on 2020-02-14.
    Thanks

  10. #10
    Registered User
    Join Date
    12-16-2021
    Location
    Brazil
    MS-Off Ver
    2019
    Posts
    1

    Re: Mouse Scroll Wheel in 64 bit

    Quote Originally Posted by Soulfien View Post
    Thanks for the reference. I was able to get this code to work, however, this type of scroll wheel function is for very short lists. It works by moving to the next selection rather than moving down the scroll bar itself. This makes for a LOOOOOOOT of scrolling to get through my long lists.

    I'll include the new file for reference. Again, I do appreciate the help. Perhaps I can see how this code works and learn how to adapt my preferred code.
    Sorry for the level of my ignorance, but how did you manage to solve/adapt this macro? I have a similar macro for Office 64 bits but when I run the mouse scroll I would like the vertical scrollbar of the Combobox only moves and not the item inside the combobox, this gets stuck when there are many items in the Combobox Array...

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: Mouse Scroll Wheel in 64 bit

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Mouse Wheel Scroll Problem
    By Lsxtrkiller in forum Excel General
    Replies: 5
    Last Post: 05-21-2019, 02:31 PM
  2. Scroll horizontally with a mouse wheel
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-12-2010, 11:16 AM
  3. Scroll with mouse wheel on userform
    By Josh_123456 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2007, 08:19 PM
  4. How do I turn off MS mouse wheel scroll?
    By MrBill in forum Excel General
    Replies: 8
    Last Post: 07-20-2006, 01:45 PM
  5. Wheel on mouse doesn't scroll in VB
    By Nolan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-12-2006, 08:35 AM
  6. Using mouse wheel to scroll drop down
    By rfielack in forum Excel General
    Replies: 0
    Last Post: 01-14-2006, 06:10 PM
  7. [SOLVED] scroll with wheel mouse
    By Scott in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-11-2005, 04:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1