Microsoft KB Archive/78125

{|
 * width="100%"|

WINDOW.MOVE Returns Error Message if Window Is Maximized

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, versions 2.x, 3.0, 4.0, 5.0
 * Microsoft Excel for OS/2, versions 2.2, 2.21 and 3.0

-

SYMPTOMS
In Microsoft Excel, when you use the WINDOW.MOVE macro function, you receive a macro error if the active window or the window specified in the WINDOW.MOVE function is maximized.

NOTE: In versions of Microsoft Excel previous to version 4.0, the equivalent macro function is MOVE. This function has the same behavior.

WORKAROUNDS

 * To avoid receiving the error message and move the window whether it is maximized or not, use the following command in your macro before you use the WINDOW.MOVE function:

=WINDOW.RESTORE
 * To only avoid receiving the error message and not move the window when it is maximized, use the following command in your macro before you use the WINDOW.MOVE function:

=ERROR(FALSE)
 * To test to see whether the active window is maximized before you use the WINDOW.MOVE function, use the following command in your macro:

=GET.WINDOW(20)

This statement returns TRUE if the window is maximized; FALSE otherwise.

MORE INFORMATION
The WINDOW.MOVE function moves the upper-left corner of a document window to a specified horizontal and vertical position. For example, the macro command, =WINDOW.MOVE(1,1) moves the upper-left corner of the active window to the position (1,1) (measured in points).