PDA

View Full Version : [SOLVED] screenupdating error



ProteanBeing
03-11-2008, 05:49 AM
when i try to run the following code:

Application.ScreenUpdating = False
Application.GoTo Reference:=Worksheets("Master Log").Range("A1")
It shows the Master Log sheet. When I trace this program and stop on the second line applicaton.screenupdating still equals TRUE. Please help

Bob Phillips
03-11-2008, 06:36 AM
Okay, then try this



Application.ScreenUpdating = False
Debug.Print Application.ScreenUpdating
Application.Goto Reference:=Worksheets("Master Log").Range("A1")

ProteanBeing
03-11-2008, 11:21 AM
Debug shows it as False.

Bob Phillips
03-11-2008, 12:37 PM
Exactly! So what do you deduce from that?

ProteanBeing
03-11-2008, 01:06 PM
That something is overriding the value (or superceding it)

Bob Phillips
03-11-2008, 01:50 PM
Well yes in a way.

If you turn off ScreenUpdating, contrary to what Help says, when the procedure completes, it is back on again. That is, when Excel takes back control, Screenupdating is automatically turned on.

So my reading is that if you interrupt code to do something that involves the screen then Excel takes over and Screenupdating is restored

ProteanBeing
03-12-2008, 05:42 AM
Yes but when I step through the program, hover the cursor over application.screenupdating is shows TRUE immediately after the line

application.screenupdating = FALSE

Bob Phillips
03-12-2008, 06:00 AM
Because steepping through and hovering causes screen interaction, hence it needs to make updating available to show you the values. That was exactly the point I was driving at.

ProteanBeing
03-12-2008, 08:32 AM
so your saying that breaking the program caused screenupdating to revert back to TRUE?