XL: Worksheet May Be Activated When Method Is AppliedLast reviewed: March 27, 1997Article ID: Q106463 |
5.00 5.00c 7.00
WINDOWS
kbusage
The information in this article applies to:
SUMMARYWhen you apply methods or change properties of a worksheet, the target worksheet may need to be activated before the macro can perform the requested action. If the worksheet is not already active, a brief flash will be noticeable on the screen when the sheet is activated.
WORKAROUNDTo resolve the problem explained in this article, add the following line to the beginning of your Visual Basic for Applications macro:
Application.ScreenUpdating = False MORE INFORMATIONSome methods and properties that are applied to worksheets will cause the worksheet to be briefly activated.
Steps to Reproduce Behavior
ActiveWorkbook.Sheets("Sheet1").Unprotect ActiveWorkbook.Sheets("Sheet1").Visible = TrueSome methods or properties, such as the one in the following example, may activate the sheet and cause it to remain the active sheet:
ActiveWorkbook.Sheets("Sheet1").Move |
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |