Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default ScreenUpdating automatically resets to True

It's nothing to do with activating a worksheet, it is simply local to the
procedure it is set in. When that procedure ends, it reverts back to True,
as stated in the online help.

--

HTH

Bob Phillips

"onedaywhen" wrote in message
m...
The ScreenUpdating property seems to implicitly/automatically be set
to true when a worksheet is activated. Is this expected behaviour? I
would expect the value of ScreenUpdating to persist until *I* change
it.

Here's some code that demonstrates what I mean (paste it into all
worksheet code modules):

Private Sub Worksheet_Deactivate()
With Application
.ScreenUpdating = False
.Cursor = xlWait
End With
End Sub

Private Sub Worksheet_Activate()
With Application
Stop ' ScreenUpdating should be False
.ScreenUpdating = True
.Cursor = xlDefault
End With
End Sub

When the Stop is encountered ScreenUpdating should be false; it was
set to false when the cursor was changed to the hourglass. However, at
the Stop I have the hourglass cursor but ScreenUpdating is now true.

Sure, I can turn it off again but I get a flicker each time I toggle
this property. And because in reality I'm using the
_Activate/_Deactivate events to run initialize/cleanup code, possibly
reactivating the worksheets in the process, this is adding up to a lot
of flickering ... which is of course what I was trying to eliminate by
turning ScreenUpdating off!

Is this something I've got to learn to live with or is it likely I'm
doing something wrong?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default ScreenUpdating automatically resets to True

Bob,
Thanks for replying.

It's nothing to do with activating a worksheet, it is simply local to the
procedure it is set in. When that procedure ends, it reverts back to True,
as stated in the online help.


That's not what it says in the online (F1) help for the version of
Excel I'm using, being Excel 2003 beta. Rather than saying it reverts
to True, it actually tells *me* to change it back to True, quote:

"Remember to set the ScreenUpdating property back to True
when your macro ends."

This confirms it isn't local to the procedure it is set in otherwise
they'd be no need to set the ScreenUpdating property back to True, I
could just let it go out of scope. Or am I missing something (a help
file, the point, etc)?

Thanks again.

"Bob Phillips" wrote in message ...
It's nothing to do with activating a worksheet, it is simply local to the
procedure it is set in. When that procedure ends, it reverts back to True,
as stated in the online help.

--

HTH

Bob Phillips

"onedaywhen" wrote in message
m...
The ScreenUpdating property seems to implicitly/automatically be set
to true when a worksheet is activated. Is this expected behaviour? I
would expect the value of ScreenUpdating to persist until *I* change
it.

Here's some code that demonstrates what I mean (paste it into all
worksheet code modules):

Private Sub Worksheet_Deactivate()
With Application
.ScreenUpdating = False
.Cursor = xlWait
End With
End Sub

Private Sub Worksheet_Activate()
With Application
Stop ' ScreenUpdating should be False
.ScreenUpdating = True
.Cursor = xlDefault
End With
End Sub

When the Stop is encountered ScreenUpdating should be false; it was
set to false when the cursor was changed to the hourglass. However, at
the Stop I have the hourglass cursor but ScreenUpdating is now true.

Sure, I can turn it off again but I get a flicker each time I toggle
this property. And because in reality I'm using the
_Activate/_Deactivate events to run initialize/cleanup code, possibly
reactivating the worksheets in the process, this is adding up to a lot
of flickering ... which is of course what I was trying to eliminate by
turning ScreenUpdating off!

Is this something I've got to learn to live with or is it likely I'm
doing something wrong?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default ScreenUpdating automatically resets to True

Can anyone shed any light on why my help file shows contradictory
information about Application.ScreenUpdating to Bob Phillips'?

Bob's says ScreenUpdating is local to the procedure it is used in and
its value reverts to True when the local procedure ends. However, mine
(Excel 2002 and Excel 2003 beta) says *I* must revert the value to
True thereby implying its scope is global, as I would expect from an
Application-level property.

Can anyone suggest which is right?

Many thanks.

(onedaywhen) wrote in message . com...
Bob,
Thanks for replying.

It's nothing to do with activating a worksheet, it is simply local to the
procedure it is set in. When that procedure ends, it reverts back to True,
as stated in the online help.


That's not what it says in the online (F1) help for the version of
Excel I'm using, being Excel 2003 beta. Rather than saying it reverts
to True, it actually tells *me* to change it back to True, quote:

"Remember to set the ScreenUpdating property back to True
when your macro ends."

This confirms it isn't local to the procedure it is set in otherwise
they'd be no need to set the ScreenUpdating property back to True, I
could just let it go out of scope. Or am I missing something (a help
file, the point, etc)?

Thanks again.

"Bob Phillips" wrote in message ...
It's nothing to do with activating a worksheet, it is simply local to the
procedure it is set in. When that procedure ends, it reverts back to True,
as stated in the online help.

--

HTH

Bob Phillips

"onedaywhen" wrote in message
m...
The ScreenUpdating property seems to implicitly/automatically be set
to true when a worksheet is activated. Is this expected behaviour? I
would expect the value of ScreenUpdating to persist until *I* change
it.

Here's some code that demonstrates what I mean (paste it into all
worksheet code modules):

Private Sub Worksheet_Deactivate()
With Application
.ScreenUpdating = False
.Cursor = xlWait
End With
End Sub

Private Sub Worksheet_Activate()
With Application
Stop ' ScreenUpdating should be False
.ScreenUpdating = True
.Cursor = xlDefault
End With
End Sub

When the Stop is encountered ScreenUpdating should be false; it was
set to false when the cursor was changed to the hourglass. However, at
the Stop I have the hourglass cursor but ScreenUpdating is now true.

Sure, I can turn it off again but I get a flicker each time I toggle
this property. And because in reality I'm using the
_Activate/_Deactivate events to run initialize/cleanup code, possibly
reactivating the worksheets in the process, this is adding up to a lot
of flickering ... which is of course what I was trying to eliminate by
turning ScreenUpdating off!

Is this something I've got to learn to live with or is it likely I'm
doing something wrong?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default ScreenUpdating automatically resets to True


The help file is making a suggestion that is a good idea in case the
behavior of the ScreenUpdating property changes in some future version of
Excel. But for all current versions of Excel, ScreenUpdating will revert to
True when the VBA code in which it was set has run to completion.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"onedaywhen" wrote in message
m...
Can anyone shed any light on why my help file shows contradictory
information about Application.ScreenUpdating to Bob Phillips'?

Bob's says ScreenUpdating is local to the procedure it is used in and
its value reverts to True when the local procedure ends. However, mine
(Excel 2002 and Excel 2003 beta) says *I* must revert the value to
True thereby implying its scope is global, as I would expect from an
Application-level property.

Can anyone suggest which is right?

Many thanks.

(onedaywhen) wrote in message

. com...
Bob,
Thanks for replying.

It's nothing to do with activating a worksheet, it is simply local to

the
procedure it is set in. When that procedure ends, it reverts back to

True,
as stated in the online help.


That's not what it says in the online (F1) help for the version of
Excel I'm using, being Excel 2003 beta. Rather than saying it reverts
to True, it actually tells *me* to change it back to True, quote:

"Remember to set the ScreenUpdating property back to True
when your macro ends."

This confirms it isn't local to the procedure it is set in otherwise
they'd be no need to set the ScreenUpdating property back to True, I
could just let it go out of scope. Or am I missing something (a help
file, the point, etc)?

Thanks again.

"Bob Phillips" wrote in message

...
It's nothing to do with activating a worksheet, it is simply local to

the
procedure it is set in. When that procedure ends, it reverts back to

True,
as stated in the online help.

--

HTH

Bob Phillips

"onedaywhen" wrote in message
m...
The ScreenUpdating property seems to implicitly/automatically be set
to true when a worksheet is activated. Is this expected behaviour? I
would expect the value of ScreenUpdating to persist until *I* change
it.

Here's some code that demonstrates what I mean (paste it into all
worksheet code modules):

Private Sub Worksheet_Deactivate()
With Application
.ScreenUpdating = False
.Cursor = xlWait
End With
End Sub

Private Sub Worksheet_Activate()
With Application
Stop ' ScreenUpdating should be False
.ScreenUpdating = True
.Cursor = xlDefault
End With
End Sub

When the Stop is encountered ScreenUpdating should be false; it was
set to false when the cursor was changed to the hourglass. However,

at
the Stop I have the hourglass cursor but ScreenUpdating is now true.

Sure, I can turn it off again but I get a flicker each time I toggle
this property. And because in reality I'm using the
_Activate/_Deactivate events to run initialize/cleanup code,

possibly
reactivating the worksheets in the process, this is adding up to a

lot
of flickering ... which is of course what I was trying to eliminate

by
turning ScreenUpdating off!

Is this something I've got to learn to live with or is it likely I'm
doing something wrong?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
about screenupdating baha Excel Discussion (Misc queries) 0 March 25th 10 06:16 AM
Automatically fill in TRUE values Ron St Jean Excel Discussion (Misc queries) 2 November 19th 08 06:35 PM
Excel automatically resets default save file format [email protected] Excel Discussion (Misc queries) 1 October 17th 07 06:38 PM
Screenupdating Problems Trent Excel Discussion (Misc queries) 0 April 28th 06 07:03 AM
What does ScreenUpdating = False do? Judy Ward Excel Worksheet Functions 5 July 9th 05 09:25 AM


All times are GMT +1. The time now is 02:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"