-
Excel in 1:1 Verhältnis öffnen
Dieser Code muss unter “DieseArbeitsmappe”.
[vba]
Sub Workbook_Open()
Call ScreenResolution
With ActiveWindow
.WindowState = xlNormal
If lHsize < 2000 Then
.Application.Width = 800
.Application.Height = 800
.Application.Left = 50
.Application.Top = 50
Else
.Application.Width = 1024
.Application.Height = 1024
.Application.Left = 150
.Application.Top = 150
End If
End With
ActiveWindow.Zoom = 145
End Sub
[/vba]
Dieser Code muss in ein Modul.
[vba]Public Declare PtrSafe Function GetSystemMetrics Lib “user32” (ByVal nIndex As Long) As Long
Public lHsize As Long, lVsize As Long
Const SM_CXSCREEN = 0
Const SM_CYSCREEN = 1
Function ScreenResolution()
‘ lHsize = Breite des Bildschirms in Pixeln
‘ lVsize = Höhe des Bildschirms in Pixeln
lHsize = GetSystemMetrics(SM_CXSCREEN)
lVsize = GetSystemMetrics(SM_CYSCREEN)
End Function[/vba]
Sorry, there were no replies found.
Log in to reply.