T800G / OfficeScroll

Enhanced mouse wheel scroll add-in for Microsoft Excel and Word
162 stars 18 forks source link

enh req : moving between sheets with CTRL-ALT-scroll #4

Closed perlsmith closed 4 years ago

perlsmith commented 6 years ago

Works great. Could you enhance to move between sheets (what CTRL-PgUp/PgDn accomplish) using CTRL-ALT-scrollwheel?

Or give us hints on how to modify and build the project ourselves?

Thanks

GitKDF commented 6 years ago

I have a fork of this project where I've added this capability (and it is quite handy), as well as some other features. A limitation is that while I updated it to scroll the window under the cursor if the system is set to do so, changing sheets only works on the topmost excel window. It doesn't have to have focus (i.e. another application can have the desktop focus) but it does have to be excel's "ActiveWindow".

I tried and got it working with some more complicated IDispatch calls, but there were things I didn't care for. It had issues if you did it while editing a cell, and excel treated it as running a macro, which cleared the undo stack, which I wasn't cool really with. Ultimately I ended up indeed sending excel Ctrl+Pg(Up/Dn) messages.

I have only tested it on my machine, which is running Windows 10 (64bit), and Office365 (32bit). I can't see anything that would immediately cause issues on other combos, but can't say for sure. I added a 64bit release build that compiled fine, but don't have a 64bit office install to try it.

Feel free to give it a test run if you'd like and let me know how it works if you do. Just replace your MsoScroll[64].dll in %appdata%\Microsoft\AddIns

perlsmith commented 6 years ago

Excellent! Thanks!

On Wed, Jun 27, 2018 at 7:02 PM, GitKDF notifications@github.com wrote:

I have a fork of this project where I've added this capability (and it is quite handy), as well as some other features. A limitation is that while I updated it to scroll the window under the cursor if the system is set to do so, changing sheets only works on the topmost excel window. It doesn't have to have focus (i.e. another application can have the desktop focus) but it does have to be excel's "ActiveWindow".

I tried and got it working with some more complicated IDispatch calls, but there were things I didn't care for. It had issues if you did it while editing a cell, and excel treated it as running a macro, which cleared the undo stack, which I wasn't cool really with. Ultimately I ended up indeed sending excel Ctrl+Pg(Up/Dn) messages.

I have only tested it on my machine, which is running Windows 10 (64bit), and Office365 (32bit). I can't see anything that would immediately cause issues on other combos, but can't say for sure. I added a 64bit release build that compiled fine, but don't have a 64bit office install to try it.

Feel free to give it a test run if you'd like and let me know how it works if you do. Just replace your MsoScroll[64].dll in %appdata%\Microsoft\AddIns

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/T800G/OfficeScroll/issues/4#issuecomment-400867837, or mute the thread https://github.com/notifications/unsubscribe-auth/AJtZSfswSpTxvJbTNDsp5YwQZweFk3_iks5uBB0MgaJpZM4TJG1O .

GitKDF commented 6 years ago

I started out modifying this project just for myself since I'd been using it for several years before it was on GitHub, but was constantly annoyed that excel didn't scroll the window under the cursor even though windows has supports it for a while now. I also have an AHK script that allows Shift Horizontal and Alt for page scrolling, but it ignores excel and word windows since they use their own hooks (which is why they don't behave properly in the first place).

At this point, however, I've tried to comment it well and it may be worth seeing if the original author is interested in bringing in any of my updates, as supporting scroll window under cursor is an expected feature these days, in my opinion. The suppression of the alt key menu hints also seems like expected OEM behavior.

I made a number of bug fixes since my prior post, largely to the Alt key press suppression functionality which I had slightly broken (if you're using that one, try opening the text to columns window, and pressing alt+f to select finish, and you'll see that the ribbon key hints are displayed because the add-in sent Excel an alt keypress).

I also added the ability to toggle the handling of Ctrl+Alt+Scroll to change sheets (hold Ctrl, press alt 5+ times, holding on the last time, then scroll). This requires an updated MsoScroll.xla, though the original will work with the updated binary, but that functionality will default to disabled. I included my revised MsoScroll.dot word add-in, though the old one will work with the my binaries as well, but I added some additional error handling to be a bit more graceful if there's a problem rather than using Debug.Assert that causes a breakpoint.

As mentioned in my previous post, and I'm manually testing this on my own system, not under different versions (OS, Office, or bitnesses), and I'm certainly not a professional developer, so use at your own risk. And by all means, I welcome any feedback.

GitKDF commented 6 years ago

I keep changing things. 😆 I think I'm getting pretty happy with it though. There's a new version on my fork that allows changing scroll settings for Excel from a toolbar button. This should work with pre-2007 versions of Excel. The binaries should still work with the original XLA and DOT files, though sheet scrolling in Excel will be disabled. The new XLA file allows changing the scroll settings in Excel, and the DOT file is just improved for error handling and code maintenance.

I wish I had easy access to test different versions and bitnesses, but I think it'll all work. I wonder slightly if I've missed anything that would fall apart in the XLA on a 64 bit installation though.

perlsmith commented 6 years ago

Hello! The utility worked fine on two other PCs, but this latest one, it's not working :)

What could be going on?

Thanks! Ananth

godey4me commented 6 years ago

@GitKDF Could you release an install version of your fork for us novices. I downloaded yours but it does not have a .bat file to instal like the original version.

Thanks

T800G commented 4 years ago

Implemented in forked project