XL97: ScreenUpdating Causes Problems in MS Internet Explorer

Last reviewed: February 27, 1998
Article ID: Q160600
The information in this article applies to:
  • Microsoft Excel 97 for Windows
  • Microsoft Internet Explorer for Windows, version 3.x

SYMPTOMS

When you view a Microsoft Excel worksheet in Microsoft Internet Explorer, version 3.0 or 3.01, and run a Visual Basic for Applications macro, Microsoft Excel may not redraw the worksheet correctly after the macro is finished running. When this behavior occurs, cells and objects in the worksheet may not appear to be updated by the macro.

CAUSE

This problem may occur when you run a macro that turns off screen updating with the following line of code:

   Application.ScreenUpdating = False

The problem will occur even if your macro also includes the following line of code:

   Application.ScreenUpdating = True

WORKAROUND

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.

To work around this behavior, use either of the following methods.

Method 1

You can force the worksheet to be redrawn correctly by resizing the Microsoft Internet Explorer window in any way. For example, resize the window by doing any of the following:

  • Minimize, and then restore the window
  • Maximize, and then restore the window
  • Resize the window manually

Method 2

If the macro includes the following line of code:

   Application.ScreenUpdating = True

you can force the worksheet to redraw correctly programmatically by displaying a different section of the worksheet and returning to the cell range you originally selected. When you do this, you force the screen to be redrawn, which prevents the problem from occurring. To do this, add the following lines of code to the end of the macro immediately before the "End Sub" line:

   Set xRange = Selection    'Set a variable to the active selection.
   Range("IV65536").Select   'Select another cell in the sheet.
   xRange.Select             'Select the original range.

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.

MORE INFORMATION

In Microsoft Excel, you can disable screen updating while running a macro by adding the following line of code:

   Application.ScreenUpdating = False

Screen updating remains disabled until the macro finishes running or you re- enable updating by setting the ScreenUpdating property to True.

If you run a macro that sets ScreenUpdating to False while you view a worksheet in Microsoft Internet Explorer, ScreenUpdating is not correctly re-enabled when the macro is finished running.


Additional query words: 97 XL97
Keywords : kbcode xlvbainfo xlui xlweb
Version : WINDOWS: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.