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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top