Screen redrawing

D

David

Hi,
I've seen and religiously use the oft suggested technique to stop screen
flicker/refresh with running macros:
application.screenupdating=false
your code
application.screenupdating=true

I have one workbook, however, that merely switching between workbooks will
cause this workbook to redraw its selected sheet 3 times! Very annoying.

Could it be that its Workbook_Activate routine adds custom menus? Other
workbooks don't act that way even when menus are added. I've even gone so
far as to include all three:
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual

No change.
Can anyone shed light on this phenomenon, or offer a solution?
 
D

Dave Peterson

I think I'd just pepper my code with:

Debug.print application.screenupdating & "--Step ###"

Then run the code and see where it changed from false to true.

Maybe you have code that calls other code that toggles the screenupdating
setting. Maybe you're using a function that turns it off (often rare and I
think mostly from the analysis toolpak???).

Depending on what you find, it may mean that you can only add screenupdating =
false as soon as you see it toggled on (especially if you don't control the
other code).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top