Excel VBA Setting Application.ScreenUpdating Not Setting New State

KF4UYC 60 Reputation points
2026-09-20T22:10:54.8266667+00:00

To the Community:

Suddenly having an issue with the Excel VBA ScreenUpdating Method where setting the state to 'False' results in no change of state, despite the value data-type being assigned. I have seen a number of postings regarding this with answers to all extremes but seemingly below is a simple attempted implementation that reflects the same problem. The code was not an issue some days ago but our employees began experiencing problems with the screens not behaving properly.

Can anyone shed some light on my darkness as to why I suddenly cannot simply change the updating state to False now? Any assistance is much appreciated!

The below snippet was snagged from our production system to simplify for the question but it still produces nothing but 'Application.ScreenUpdating = True' results...

Thanks! ----James

'these are in a "Globals" module in the project...
 Global Const conPPRAudSvcFlg As Byte = 1
 Global Const conPPRScnUpdFlg As Byte = 2
 Global Const conPPRTrmCelFlg As Byte = 4
 Global Const conPPRTrmWksFlg As Byte = 8
 Global Const conPPRSrtWksFlg As Byte = 16
 Global Const conPPRPwdWksFlg As Byte = 32
 Global Const bolPPRWkvGenBtA As Byte = 0   'unused
 Global Const bolPPRWkvGenBtB As Byte = 0   'unused

Sub PlanProcessorsMacro()
    Call PPS_PlanProcessorMacro(2, 2) 'call with wkb/wks indicies, no flags set
End Sub

Sub PPS_PlanProcessorMacro(Optional ByRef lngPPRWkbPPrIdx As Long = 0, Optional ByRef lngPPRWksPPrIdx As Long = 0, _
                           Optional ByVal bytPPRPPrOptFlg As Byte = 0)
 Dim bolPPRAudSvcFlg As Boolean
 Dim bolPPRScnUpdFlg As Boolean
 Dim bolPPRTrmCelFlg As Boolean
 Dim bolPPRTrmWksFlg As Boolean
 Dim bolPPRSrtWksFlg As Boolean
 Dim bolPPRPwdWksFlg As Boolean
 Dim bolPPRWkvGenBtA As Boolean
 Dim bolPPRWkvGenBtB As Boolean
 Dim bolPPRScnUpdCur As Boolean 'current state of refresh

 bolPPRAudSvcFlg = CBool(bytPPRPPrOptFlg And conPPRAudSvcFlg)
 bolPPRScnUpdFlg = CBool(bytPPRPPrOptFlg And conPPRScnUpdFlg)
 bolPPRTrmCelFlg = CBool(bytPPRPPrOptFlg And conPPRTrmCelFlg)
 bolPPRTrmWksFlg = CBool(bytPPRPPrOptFlg And conPPRTrmWksFlg)
 bolPPRSrtWksFlg = CBool(bytPPRPPrOptFlg And conPPRSrtWksFlg)
 bolPPRPwdWksFlg = CBool(bytPPRPPrOptFlg And conPPRPwdWksFlg)
'bolPPRWkvGenBtA = CBool(bytPPRPPrOptFlg And bolPPRWkvGenBtA) 'future
'bolPPRWkvGenBtB = CBool(bytPPRPPrOptFlg And bolPPRWkvGenBtB) 'future

 bolPPRScnUpdCur = Application.ScreenUpdating
'ABOVE: Application.ScreenUpdating = True &  bolPPRScnUpdCur = True OKAY!

 Application.ScreenUpdating = bolPPRScnUpdFlg 
'ABOVE: bolPPRScnUpdFlg = False...but...Application.ScreenUpdating returns True!

 Application.ScreenUpdating = Not (True) 
'ABOVE: Not (True)=False...but... Application.ScreenUpdating returns True!

 Application.ScreenUpdating = False                 
'Application.ScreenUpdating = False...but... Application.ScreenUpdating returns True!
End Sub 

Developer technologies | Visual Basic for Applications
0 comments No comments

Answer accepted by question author
Jay Pham (WICLOUD CORPORATION) 4,675 Reputation points Microsoft External Staff Moderator
2026-09-21T01:09:43.9233333+00:00

Hi @KF4UYC ,

Application.ScreenUpdating is a read/write Boolean property, so the direct statement Application.ScreenUpdating = False should take effect during macro execution. Because your final literal assignment does not depend on the option flags, I do not think the bitmask calculation explains this behavior.

The first point I suggest isolating is how the value is being observed. Please run the following test continuously with Run, without stepping through it or stopping at a breakpoint. After it finishes, check the Immediate window output.


Sub TestScreenUpdating()

    Dim originalState As Boolean

    Dim capturedState As Boolean

    originalState = Application.ScreenUpdating

    On Error GoTo CleanUp

    Debug.Print "Version=" & Application.Version & _

                "; Build=" & Application.Build

    Debug.Print "Before=" & Application.ScreenUpdating

    Application.ScreenUpdating = False

    capturedState = Application.ScreenUpdating

    Debug.Print "Immediately after False=" & capturedState

CleanUp:

    Application.ScreenUpdating = originalState

    Debug.Print "Restored=" & Application.ScreenUpdating

    If Err.Number <> 0 Then

        Debug.Print "Error " & Err.Number & ": " & Err.Description

    End If

End Sub

If Immediately after False=False is printed, the property was changed successfully during execution, and the True value is likely being observed after execution pauses or completes.

If it prints True, I suggest repeating the test in a new blank workbook and then starting Excel in Safe Mode with excel.exe /safe. Please also provide the full version, build, update channel, and 32-bit or 64-bit information shown under File > Account > About Excel. Since this began recently for several employees, comparing those details with one unaffected computer would help determine whether an Office update is involved.

I would avoid rolling back Office until the exact build correlation and Safe Mode result are known.

If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation. 

Thank you. 

Was this answer helpful?

1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. KF4UYC 60 Reputation points
    2026-09-21T14:58:03.6866667+00:00

    Jay,

    Greetings, loaded up your code and if it taught me anything as a life-long developer is to never trust what you see but rather what your code tells you...!

    Your snippet proved to be correct in that the Boolean state is being changed (see your output below) and I should have tested in debug (duh!) instead of value-hovering over the variable name (see photo)...the hover value continues to say 'True' but in fact your code proved it to be otherwise. I went back to the original code and indeed debug tells me "False' but hover tells me 'True'...my bad! As for the screen behaviors I will need to look elsewhere to see if any of my staff changed something upstream.

    Thanks for all the help...it was greatly appreciated and humbling to say the least!

    James

    Screenshot 2026-09-21 104229

    Screenshot 2026-09-21 104121

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.