XL97: ScreenUpdating Causes Problems in MS Internet ExplorerLast reviewed: February 27, 1998Article ID: Q160600 |
The information in this article applies to:
SYMPTOMSWhen 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.
CAUSEThis problem may occur when you run a macro that turns off screen updating with the following line of code:
Application.ScreenUpdating = FalseThe problem will occur even if your macro also includes the following line of code:
Application.ScreenUpdating = True WORKAROUNDMicrosoft 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 1You 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:
Method 2If the macro includes the following line of code:
Application.ScreenUpdating = Trueyou 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. STATUSMicrosoft 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 INFORMATIONIn Microsoft Excel, you can disable screen updating while running a macro by adding the following line of code:
Application.ScreenUpdating = FalseScreen 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |