Thursday, 5 September 2013

find out windows in side-by-side mode with Excel VBA

find out windows in side-by-side mode with Excel VBA

The "View Side By Side" and "Synchronous Scrolling" made the comparison of
2 spreadsheets easier than ever. However, there isn't a "Synchronous
Switching tab" feature, so if I switch to a different tab in one of the
workbooks and continue scrolling, the sync'ed scrolling become quite
funny.
Well, I shouldn't complain, because it's all done manually, and I should
use this feature wisely.
As a lazy developer, I would like to write some code to dig myself out:
Can I write a macro to automate the worksheet switching on the peer window
in side-by-side mode?
It breaks down to 2 steps:
how do I know if a window, most likely the ActiveWindow, is in
side-by-side mode?
if it is, how do I tell which window is its peer?
I did my homework. It seems Excel is not very programming friendly on this
feature. There are 3 methods
BreakSideBySide()
CompareSideBySideWith(WindowName)
ResetPositionsSideBySide()
and 1 Boolean property
SyncScrollingSideBySide
on the Windows collection related to this feature, but are insufficient to
solve my questions.
Does anyone have any idea how to achieve this? Or, is it indeed
impossible? Thank you in advance.

No comments:

Post a Comment