Article ID: 163011
Article Last Modified on 10/22/2000
APPLIES TO
- Microsoft Excel 97 Standard Edition
This article was previously published under Q163011
SYMPTOMS
When you record a Visual Basic for Applications macro in Microsoft Excel
97, the hidden DrawingObjects method is recorded in your macro.
Specifically, the following line of code is recorded:
ActiveSheet.DrawingObjects.Select
CAUSE
This behavior occurs when you record a macro in which you select all of the
objects in a worksheet.
Although the DrawingObjects method is hidden in Microsoft Excel 97, it
provides the same functionality that it does in earlier versions of
Microsoft Excel. If you select all the objects in a worksheet while
recording a macro, the recorded code uses the DrawingObjects method instead
of the Shapes collection.
This behavior is by design of Microsoft Excel.
WORKAROUND
If you prefer to use the Shapes collection instead of the DrawingObjects
method, replace the line of recorded code. To do this, search the macro for
the following code:
ActiveSheet.DrawingObjects.Select
Replace this code with the following code:
ActiveSheet.Shapes.SelectAll
Both lines of code are functionally identical.
Additional query words: 97 XL97
Keywords: kbbug kbdtacode KB163011