ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Screen redrawing (https://www.excelbanter.com/excel-discussion-misc-queries/57239-screen-redrawing.html)

David

Screen redrawing
 
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?

--
David

Dave Peterson

Screen redrawing
 
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).

David wrote:

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?

--
David


--

Dave Peterson


All times are GMT +1. The time now is 09:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com