PDA

View Full Version : [Application.ScreenUpdating = False] but screen still flickers...



cheapdrunk
03-18-2006, 07:40 PM
Hi all,

okies... can anyone tell me why Excel flickers even with this simple macro?

ThisWorkBook code:Dim AppClass As New EventClass


Private Sub Workbook_Open()
Set AppClass.App = Application
End Sub
TestModule code:

Public Sub sheet_modified()
Application.ScreenUpdating = False
' --- actual code goes here ---
Application.ScreenUpdating = True
End Sub
EventClassModule code:

Public WithEvents App As Application

Private Sub App_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Call sheet_modified
End Sub.
please note: there would usually be code between the ScreenUpdating statements but for the purposes of testing I have omitted them.

The problem I have is that even if screenupdating is turned off then immediately turned back on, my screen flickers whenever a sheet change happens! :dunno

Has anyone else seen this?

Dan :giggle

mdmackillop
03-19-2006, 05:18 AM
I came across this recently. In effect the sheet has to change before the macro is triggered, hence a flicker.
Regards
MD

XLGibbs
03-19-2006, 08:12 AM
You also need to disable events and calculation to prevent the flicker, as some events force a screenupdate even when it is set to False.

smc2911
03-19-2006, 08:05 PM
This came up in 7393, but sadly no solution emerged.

Sean.

cheapdrunk
03-20-2006, 02:01 AM
Thanks everyone for your replies.

I'll give disabling events and calculation a go but probably won't get a chance to do it until this weekend (really the ONLY time I get to do any programming these days... :mkay

I'll message back with my findings!

Dan :)

jayjaygross
02-01-2013, 09:03 AM
I was having the same issue, disabling the event fixed it for me. Thanks for your help