Microsoft KB Archive/116391

{|
 * width="100%"|

XL5: Recorded Object Position Incorrect on Zoomed Worksheet

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, version 5.0

-

SYMPTOMS
In Microsoft Excel, when you start the macro recorder and create a drawing object, such as a line or rectangle, the object is not placed in the same location if you run the recorded macro on a worksheet with a different zoom percentage.

CAUSE
When you create a macro that creates a drawing object on a worksheet, either by recording or editing the macro, rounding errors occur in the coordinate calculations when you play the macro back on a worksheet at a different zoom factor. The rounding error may be as much as one pixel per row, and is therefore more noticeable with larger drawing objects.

WORKAROUND
To avoid this problem when you run a macro that creates a drawing object, make sure that the worksheet is at the same zoom percentage as when you recorded or created the macro. You can use the Zoom property of the Window object in your Visual Basic macro such that it sets the zoom percentage on the worksheet before it creates the object.

STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Additional query words: 5.00a

Keywords :

Version : 5.00

Platform : WINDOWS

Issue type :

Technology :