An implementation of Visual Basic that is built into Microsoft products.
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.