- 帖子
- 38
- 主題
- 14
- 精華
- 0
- 積分
- 66
- 點名
- 0
- 作業系統
- Win7
- 軟體版本
- Excel2003
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2012-7-16
- 最後登錄
- 2013-9-3
|
試著改成這樣也不行!- Private Sub Workbook_Open()
- SetXLResolution
- End Sub
- Sub SetXLResolution()
- Dim VWidth As Integer
- Dim VHeight As Integer
- VWidth = GetSystemMetrics(SM_CXSCREEN) '取得螢幕解析度的X值
- VHeight = GetSystemMetrics(SM_CYSCREEN) '取得螢幕解析度的Y值
- With Excel.Application
- 'VWidth / 1960得到與原設計解析度X值的比例
- 'VWidth / 1080得到與原設計解析度Y值的比例
- .WindowState = xlNormal ' 先將窗口還原
- .Width = VWidth * (VWidth / 1960) * 0.75 ' Points (~ 0.75 pixels)
- .Height = VHeight * (VHeight / 1080) * 0.75
- .Left = 0
- .Top = 0
- End With
- End Sub
複製代碼 |
|