XL97: Cannot Use xlDisplayShapes with DisplayDrawingObjects

Last reviewed: March 13, 1998
Article ID: Q163741
The information in this article applies to:
  • Microsoft Excel 97 for Windows

SYMPTOMS

When you run a Visual Basic for Applications macro that refers to the DisplayDrawingObjects property of Microsoft Excel 97, you may receive the following error message:

   Compile error:
   Type mismatch

CAUSE

This problem occurs when your macro contains a line of code that is similar to the following:

   ActiveWorkbook.DisplayDrawingObjects = xlDisplayShapes

WORKAROUND

To prevent this problem from occurring, use the constant xlAll instead of the constant xlDisplayShapes. For example, change the sample line of code to the following:

   ActiveWorkbook.DisplayDrawingObjects = xlAll

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

NOTE: The information that is in the Help topic for the DisplayDrawingObjects property is incorrect.

MORE INFORMATION

In Microsoft Excel, use the DisplayDrawingObjects property to determine how drawing objects are displayed in a workbook. You can use the following constants when you set the DisplayDrawingObjects property.

   Constant         Description
   --------------------------------------------------------------------

   xlAll            Show all shapes
   xlPlaceholders   Show placeholders for each shape
   xlHide           Hide all shapes

In Microsoft Excel 97, the Help topic for DisplayDrawingObjects indicates that you can use the constant xlDisplayShapes instead of the constant xlAll. This information is incorrect.


Additional query words: 97 XL97
Keywords : kberrmsg kbprg kbdocerr
Version : WINDOWS:97
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 13, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.