XL: Pointer is an Hourglass When You Display a Message Box

Last reviewed: February 27, 1998
Article ID: Q159964
The information in this article applies to:
  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows 95, versions 7.0, 7.0a
  • Microsoft Excel 97 for Windows

SYMPTOMS

When you run a Visual Basic for Applications macro in Microsoft Excel 97, if the macro uses the MsgBox function to display a message box on the screen, the pointer may appear as an hourglass or as the arrow pointer. When you dismiss the message box, the pointer behaves normally again.

This behavior may lead you to believe that Microsoft Excel 97 has stopped responding, or is waiting for some event to occur.

CAUSE

When you display a message box, the pointer behaves slightly differently in Microsoft Excel 97 than it does in earlier versions of Microsoft Excel.

When you run a Visual Basic for Applications macro, if you use the MsgBox function to display a message box on the screen, macro processing halts for as long as the message box remains on the screen. When you click OK, the macro continues to run.

NOTE: If you run the macro from within the Visual Basic Editor, or if you run the macro by clicking a toolbar button, the pointer does not appear as an hourglass.

RESOLUTION

If the pointer appears as an hourglass when you display a message box in Microsoft Excel 97, move the pointer inside the message box.

NOTE: If the pointer changes into a arrow pointer, and you can click a button in the message box, Microsoft Excel is behaving normally.

STATUS

This behavior is by design of Microsoft Excel 97.

MORE INFORMATION

Microsoft provides examples of Visual Basic for Applications procedures for illustration only, without warranty either expressed or implied, including, but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures in this article are provided 'as is' and Microsoft does not guarantee that they can be used in all situations. While Microsoft support engineers can help explain the functionality of a particular macro, they will not modify these examples to provide added functionality, nor will they help you construct macros to meet your specific needs. If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including creating custom macros. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426-9400.

Example Macro

The following macro displays a message box:

   Sub ShowMessageBox()
       MsgBox "This is a message box."
   End Sub

To see the change in behavior, run the macro in Microsoft Excel 5.0 or 7.0, and Microsoft Excel 97.

When you run the macro in Microsoft Excel 5.0 or 7.0, the pointer appears as a normal arrow pointer without regard to where you position it on the screen.

In Microsoft Excel 97, the pointer appears as a normal arrow pointer only when you position it inside the message box. Otherwise, it appears as an hourglass. When you click OK, the pointer behaves normally again.

Pointer Behavior

To properly reflect the fact that other macro processing halts temporarily, Microsoft Excel 97 changes the pointer to an hourglass. The pointer appears as an hourglass when the following conditions are true:

  • A message box is displayed on the screen.

        -and-
    
  • You do not position the pointer inside the message box.

        -and-
    
  • You position the pointer inside the Microsoft Excel 97 window.

        -and-
    
  • You did not run the macro from within the Visual Basic Editor or by clicking a toolbar button.

If you position the pointer inside the message box, the pointer is changed back into the normal arrow pointer. When you click OK, the pointer behaves normally.


Additional query words: 5.00 5.00c 7.00 XL97 XL7 XL5 hang lock freeze stops
responding crash
Keywords : kbcode xlvbainfo xl97vbmigrate
Version : WINDOWS:5.0,5.0c,7.0,7.0a,97
Platform : WINDOWS
Issue type : kbprb


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: February 27, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.