我的分辨率是1024*768,我是让窗口在打开时根据应用程序的窗口大小自动调整尺寸了
两次关闭是怎么回事?我这里是点一次全部关闭的。
按你400*400的要求(之前没看清)再做一次,当然这样更简单了:)
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Win As Window
'关闭触发器,关闭所有窗口,并最大化应用程序窗口
Application.EnableEvents = False
Application.ScreenUpdating = False
For Each Win In ThisWorkbook.Windows
Win.Close
Next
ActiveWindow.WindowState = xlMaximized
End Sub
Private Sub Workbook_Open()
Dim Win As Window
Application.ScreenUpdating = False
'每次打开工作簿,新增加一个窗口,垂直并排窗口
ActiveWindow.NewWindow
Windows.Arrange ArrangeStyle:=xlVertical
'循环工作簿内的所有窗口,按其窗口的编号奇偶性分别放置在两个位置
For Each Win In ThisWorkbook.Windows
With Win
.Top = 50
.Left = 50 + (.WindowNumber Mod 2) * 450
.Width = 400
.Height = 400
End With
Next
End Sub
E6VR1Lng.rar
(7.22 KB, 下载次数: 54)
[此贴子已经被作者于2005-6-27 7:14:22编辑过] |