Share via

Application.screenupdating = false does not work

Anonymous
2010-06-11T19:17:43+00:00

Hello,

The beginning of t he code I am writing turns off screen updating, but the screen still updates as the code runs.  can anyone tell me what I am missing?

This is the snipet of code that rusn off screen updating:

'   Set Application

    With Application

        DisplayAlerts = False

        ScreenUpdating = False

        Calculation = xlCalculationManual

    End With

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2010-06-11T19:58:33+00:00

The post I'm looking at doesn't have leading dots in front of the

.displayalerts, .screenupdating and .caculation.

Maybe you didn't include them in your real code???

    With Application

        .DisplayAlerts = False

        .ScreenUpdating = False

        .Calculation = xlCalculationManual

    End With

petedacook wrote:

Hello,

The beginning of t he code I am writing turns off screen updating, but the screen still updates as the code runs.  can anyone tell me what I am missing?

This is the snipet of code that rusn off screen updating:

'   Set Application

    With Application

        DisplayAlerts = False

        ScreenUpdating = False

        Calculation = xlCalculationManual

    End With

--

Dave Peterson

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2010-06-11T20:00:35+00:00

    The code opens another workbook to write to it, but it does not select the workbook, except by opening it......when the other file is opened it is then the selected file.  

    The procedures called do not toggle updating back on.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2010-06-11T19:39:57+00:00

    At any point down stream is it getting turn back on. Specifically if you have called a procedure that toggles screen updating back on at the end then the updating will show. The other common downfall of screen updating is if you are working with multple workbooks then the updating may show.


    HTH... Jim Thomlinson

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2010-06-11T20:29:45+00:00

    Good catch Dave... I did not notice the lack of dots. Note to OP: What your code was actually doing is it was declaring variables on the fly. Instead of modifying the ScreenUpdating property you were creating a new variable called ScreenUpdating. In order to fix that you should include Option Explicit at the top of every code module. That will keep VBA from allowing undeclared variables and causing the type of error that you have here. Check out this link...

    http://www.cpearson.com/excel/DeclaringVariables.aspx


    HTH... Jim Thomlinson

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2010-06-11T20:17:13+00:00

    That's it, Dave!  Thanks!

    Was this answer helpful?

    0 comments No comments