| 
    
     |  | こうさん、おはようございます。 
 すみません。相変わらずの意味不明の日本語で・・・。こっちの方も、もっと勉強致しますっ!。
 エラーが発生の間違いです。詳しくは、以下の通りです。
 
 Dim xx, yy As Integer
 Type RECT
 x1 As Long
 y1 As Long
 x2 As Long
 y2 As Long
 End Type
 
 Declare Function GetDesktopWindow Lib "User32" () As Long
 Declare Function GetWindowRect Lib "User32" _
 (ByVal hWnd As Long, rectangle As RECT) As Long
 '---------------------------------------------------------------
 Function GetScreenResolution() As String
 Dim R As RECT
 Dim hWnd As Long
 Dim RetVal As Long
 hWnd = GetDesktopWindow()
 RetVal = GetWindowRect(hWnd, R)
 'GetScreenResolution = (R.x2 - R.x1) & "x" & (R.y2 - R.y1)
 xx = R.x2 - R.x1
 yy = R.y2 - R.y1
 End Function
 
 Sub TEST_SET()
 Call GetScreenResolution
 Debug.Print xx, yy
 With Application
 .Height = yy * 0.75 + 20  ’←この箇所でエラー発生となります。
 .Width = xx * 0.75 + 0
 .Top = -20
 .Left = 0
 .CommandBars("Worksheet Menu Bar").Enabled = False
 End With
 MsgBox "ねっ!"
 With Application
 .Height = yy * 0.75 + 30
 .Width = xx * 0.75 + 0
 .Top = 0
 .Left = 0
 .CommandBars("Worksheet Menu Bar").Enabled = True
 End With
 End Sub
 
 エラー内容は、
 「実行時エラー'1004'」
 「Heightメソッドは失敗しました。:'_Applicationオブジェクト」
 です。
 
 環境は、Win2000+Office2000です。
 
 やっぱり、私がどっかでやらかしていると思うんですけど・・・。
 以上、報告でした。(^^;)
 
 |  |