none
Why Doesn't ScreenUpdating Stay Off? RRS feed

  • Question

  • Hi

    My Excel 2010 workbook contains the following code:

    Private Sub Workbook_Activate()

                        Application.ScreenUpdating = False

    End Sub


    The book does not contain any other code or defined-names. 

    On opening the book, or on activating the book from another workbook, ScreenUpdating does NOT stay off. If i step through the code and watch ScreenUpdating status, i can see that it does go false on 

    Application.ScreenUpdating = False

    However, after the procedure ends and vba stops executing, ScreenUpdating is again True.

    Why doesn't ScreenUpdating remain false?

    thx



    • Edited by johny w Thursday, October 23, 2014 6:55 PM
    Thursday, October 23, 2014 6:53 PM

All replies

  • Do you have any add-ins installed for Excel?

    What Excel version are you talking about?

    Thursday, October 23, 2014 7:14 PM
  • no add-ins.

    Excel 2010

    Thursday, October 23, 2014 10:49 PM
  • Hello,

    I had a similar experience: for some reason, when you are debuging, screenupdating does not always stay off. I have a feeling that testing your screenupdating while you're debugging, is not represantative.

    On the other hand I have no direct solution for your problem. Maybey you could create an AUTO_OPEN sub and try to set your screenupdating in that part?

    Friday, October 24, 2014 8:10 AM
  • hi

    Hello,

    I had a similar experience: for some reason, when you are debuging, screenupdating does not always stay off.

    it happens when the code execute freely, not just while debugging.

    Maybey you could create an AUTO_OPEN sub and try to set your screenupdating in that part?

    i'm concerned with the Activate event, not Open. 

    thx for suggestion, tho! 

    ps, why did you suggestion Auto_Open instead of Workbook_Open?

    best

    Friday, October 24, 2014 9:50 AM
  • However, after the procedure ends and vba stops executing, ScreenUpdating is again True.

    Correct, ScreenUpdating must be True when the GUI of Excel get the focus. Any other behavior makes no sense.

    Andreas.

    Friday, October 24, 2014 10:27 AM
  • ps, why did you suggestion Auto_Open instead of Workbook_Open?

    Both are executed on opening of your workbook, I think AUTO_OPEN is executed after workbook_open. (not sure)

    I would never use AUTO_OPEN, but when I get desperate I try silly things ;)

    Friday, October 24, 2014 2:47 PM