ScreenUpdating = False fails in Excel 2013 and 2016

后端 未结 4 1822
礼貌的吻别
礼貌的吻别 2021-01-18 01:23

Long-running, high-end Excel-based applications that I developed years ago and that run beautifully in Excel 2007 and 2010 look like Amateur Hour in Excel 2013 and 2016 beca

相关标签:
4条回答
  • 2021-01-18 01:57

    I wanted to leave a comment but I am not allowed to do so. Without a code sample it is very dificult to understand your problem (please see https://stackoverflow.com/help/how-to-ask and edit your question appropriately.

    Here are some ideas: - Check if your code calls for code in a different procedure, maybe the Application.ScreenUpdating is turned on outside of the procedure. - Try this at the beginning of your procedure:

    Application.Calculation = xlCalculationManual
    

    Then, at the end of the code set it to:

    Application.Calculation = xlCalculationAutomatic
    

    It might help; however, without a code sample it is very difficult to properly help you.

    0 讨论(0)
  • 2021-01-18 02:06

    Here is a technique that helps reduce flickering and preserves the StatusBar message.

    Application.Cursor = xlWait
    Application.ScreenUpdating = False
    . . .
    Set wkbNewBook = Workbooks.Add
    ThisWorkbook.Windows(1).Visible = False
    . . .
    ThisWorkbook.Windows(1).Visible = True
    wkbNewBook.Activate
    Application.ScreenUpdating = True
    Application.Cursor = xlDefault
    
    0 讨论(0)
  • 2021-01-18 02:20

    For me, only "Application.ScreenUpdating = False" did not completely cure the flickering. Calculation caused also the flickering. Adding "Application.Calculation = xlCalculationManual" solved the flickering issue. So, the code should be like:

    Application.ScreenUpdating = False Application.Calculation = xlCalculationManual

    ... inportant code here....

    Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic

    Nico Mijnster.

    0 讨论(0)
  • 2021-01-18 02:21

    After looking through many forums, I believe the flicker problem is related to SDI vs MDI. Someone suggested setting the application to not visible.

    Application.Visible=False
    enter code here
    Application.Visible=True
    

    This solved my flicker problem, but I didn't like how the excel application disappeared completely then suddenly reappeared for the user.

    I was able to solve the issue to my liking by using a workaround this 'which window is on top' problem.

    By leaving the main window alone, and forcing other workbooks to become not visible, letting the code run, then bringing them back to visible, it stopped flickering.

    Application.Workbooks("yourworkbooktohide").Windows(1).Visible = False
    

    Just remember to bring it back with =true.

    Again, my script worked just fine in Excel 2010, but after "upgrading" to 2013, this flicker issue started.

    0 讨论(0)
提交回复
热议问题