ActiveWindow.Width no longer works for me!

  • Thread starter Thread starter rickety
  • Start date Start date
R

rickety

I'd appreciate any pointers to help solve a problem.

Since upgrading to Office 2003 and when using an Excel application (Excel
version 11.5612.5703) I get an error

Runtime error '1004' Unable to set the Width property of the Window class.

The help does not hint (to me) at what might be the cause.

There are several places where I use this similar approach

========================
code snippet

Worksheets("StartForm").Activate


With ActiveWindow
.Width = 420
.Height = 260
End With


etc.
=======================
 
If the window is maximized this error will occur. Try making sure the
window is in the restored state:

With ActiveWindow
.WindowState = xlNormal
.Width = 420
.Height = 260
End With


--
Jim Rech
Excel MVP
| I'd appreciate any pointers to help solve a problem.
|
| Since upgrading to Office 2003 and when using an Excel application (Excel
| version 11.5612.5703) I get an error
|
| Runtime error '1004' Unable to set the Width property of the Window class.
|
| The help does not hint (to me) at what might be the cause.
|
| There are several places where I use this similar approach
|
| ========================
| code snippet
|
| Worksheets("StartForm").Activate
|
|
| With ActiveWindow
| .Width = 420
| .Height = 260
| End With
|
|
| etc.
| =======================
|
| --
| Rickety
|
|
 
Thanks Jim

I saw that info in the help file, but as the Excel window was normal,
I totally missed the fact that the worksheet window within Excel was
maximised.

I made the change, fully expecting the problem to remain - but it
went. That's how the subtlety between the Excel window and the
worksheet window became clear. Ah well, I guess I should trust the
Help files more and try out what they say, even if it doesn't seem
relevant!

Thanks again!
 
Back
Top