View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Walter Briscoe Walter Briscoe is offline
external usenet poster
 
Posts: 279
Default Controlling xlTiled windows arrangement

I have a new machine using xl2007 on Windows 10.
I believe what I have observed also applies to xl2003 on Vista,
but have not tested it
I have windows with captions:
busroutes.xls;1, busroutes.xls;2
busroutesR.xls;1, busroutesR.xls;2

by default Windows.Arrange ArrangeStyle:=xlTiled arranges
busroutesR.xls;2 busroutes.xls;1
busroutesR.xls;1 busroutes.xls;2

i.e. the windows are arranged with corresponding windows in diagonally
opposite positions.
I want to have the following arrangement:
busroutes.xls;1 busroutes.xls;2
busroutesR.xls;1 busroutesR.xls;2

The following code seems to do what I want:
Windows.Arrange ArrangeStyle:=xlCascade
Windows("busroutesR.xls;2").Activate
Windows("busroutes.xls;2").Activate
Windows("busroutesR.xls;1").Activate
Windows("busroutes.xls;1").Activate
Windows.Arrange ArrangeStyle:=xlTiled

After running the code the following shows what is happening in the
cttl+G debug pane:
for each x in windows: debug.Print x.caption:next
busroutes.xls;1
busroutesR.xls;1
busroutes.xls;2
busroutesR.xls;2
PERSONAL.XLSB

I.e., xlTiled places windows in vertical order first.

I failed to find this subject with Google.
I hope my discovery is interesting.
I hope more information and/or a better method will be volunteered. ;)
--
Walter Briscoe