Unexpected window positioning error

K

K_Macd

I recorded the following code in the macro recorder but when I run it all
methods fail giving a similar message

Sub HalfWindow()

Application.Left = 6
Application.Top = 3
Application.Width = 645
Application.Height = 780

End Sub

Run Time 1004 - Method 'Left' of object '_application' failed

Any clues ?

TIA
 
P

p45cal

It won't work on a maximised window, add
Application.WindowState = xlNormal
before the first of your 4 statements.

K_Macd;454912 said:
I recorded the following code in the macro recorder but when I run it
all
methods fail giving a similar message

Sub HalfWindow()

Application.Left = 6
Application.Top = 3
Application.Width = 645
Application.Height = 780

End Sub

Run Time 1004 - Method 'Left' of object '_application' failed

Any clues ?

TIA
 
Top