Mit unten aufgeführten Code findet die Bildschirmanpassung in meiner Mappe statt.
Was ich, nicht verstehe bzw. gerne möchte(leider nicht hin bekomme):
Meine Mappe besteht aus 18 Blätter, die Anpassung ist soweit ok(1280x1024;75).
Nun möchte ich aber das zwei bestimmte Blätter, Tab1 mit 93 und Tab9 mit 81 Zoom geöffnet werden.
Wie muß der Code ergänzt bzw. geändert werden?
Gruß
Bea
Option Explicit
Private Sub Workbook_Open()
Select Case GetScreenRes
Case "1280x1024"
ActiveWindow.Zoom = 75
Case "1024x768"
ActiveWindow.Zoom = 85
Case "800x600"
ActiveWindow.Zoom = 100
Case Else
MsgBox "unbekannte Auflösung"
End Select
End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Select Case GetScreenRes
Case "1280x1024"
ActiveWindow.Zoom = 75
Case "1024x768"
ActiveWindow.Zoom = 85
Case "800x600"
ActiveWindow.Zoom = 100
Case Else
MsgBox "unbekannte Auflösung"
End Select
End Sub
Option Explicit
Declare Function GetDeviceCaps Lib "gdi32" _
(ByVal hdc As Long, ByVal nIndex As Long) As Long
Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Declare Function ReleaseDC Lib "user32" _
(ByVal hWnd As Long, ByVal hdc As Long) As Long
Declare Sub ShowWindow Lib "user32" _
(ByVal hWnd As Long, ByVal nCmdShow As Long)
Const HORZRES = 8
Const VERTRES = 10
Function GetScreenRes()
Dim lRval As Long
Dim lDC As Long
Dim lHSize As Long
Dim lVSize As Long
lDC = GetDC(0&)
lHSize = GetDeviceCaps(lDC, HORZRES)
lVSize = GetDeviceCaps(lDC, VERTRES)
lRval = ReleaseDC(0, lDC)
GetScreenRes = lHSize & "x" & lVSize
End Function