Screen flicker when ScreenUpdating returns to True: DOES from any sub UNLESS initiated by a form control on ws

dchristmn0

New Member
Joined
Dec 5, 2011
Messages
1
My first post. Have searched every available discussion of screen flicker for Excel VBA (mine is 2007), but have not found one like this:

Widely acknowledged that when ScreenUpdating returns to True it redraws the screen. My ActiveX Buttons on the visible worksheet flicker during this redraw. This can be simulated with a simple one-line sub:

Sub Flicker()
Application.ScreenUpdating = False
End Sub

Excel returns ScreenUpdating to True when the procedure completes, the screens redraws, and the buttons flash...

UNLESS the Flicker sub was initiated by a Form-type control on the sheet instead of an ActiveX control. The screen definitely redraws, but without the flicker. To confirm, simply insert two commandButtons onto a sheet - one being of the Form Control type (call this one cbutForm), the other being of the ActiveX type (call this one cbutX).

For cbutForm, use the 'Assign Macro' selection from its context menu to associate it with the Flicker sub.

For cbutX, create

Private sub cbutX_Click()
call Flicker
End sub

on the sheet's code module.

Now, the same sub is called for both buttons. When called from the ActiveX button (or any sub or event) the screen flickers. I've seen this discussion a thousand times, and the consensus is that when ScreenUpdating returns to true and redraws the screen, flicker occurs.

HOWEVER, when called from the Form Control button (or CheckBox or OptionButton or any other Form-type control), the screen redraws BUT NO FLICKER OCCURS.

I've given up trying to figure out WHY this is. I just want to be able to take advantage of the fact that I can get a screen redraw without flicker by having a Form-type control kick off the procedure that initiates the redraw.

But, alas, I have not been able to 'click' the Form-type control from my VBA code. And not for lack of trying, either. I have tried selecting, activating, changing values, and using accelerators. Nothing I've tried will click those controls and have them fire off the procedure.

Anyone know how to 'click' a Form-type control from VBA code? Also, still curious as to why this phenomena occurs; it completely refutes the notion that ScreenUpdating returning to True and forcing a redraw causes the flicker.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,215,772
Messages
6,126,803
Members
449,337
Latest member
BBV123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top