Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Why oh why!!!

Has anybody ever experienced this before?
Has anybody got a clue how to fix it?

Somehow something has happened to my Excel2003/PC (running on XP) so
that I can go into the Immediate window and run the first line below,
and then if I question what the state of the screenupdating is
immediately afterward I've set it to False I get a result of True !!

Application.ScreenUpdating =False
?Application.ScreenUpdating
True


Any help greatly appreciated,
Regards
Jason.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Why oh why!!!

Surpised me, too, but it seems like an inconsequential error.
The following resulted in False in the Immediate Window.

Application.ScreenUpdating = False
Debug.Print Application.ScreenUpdating

Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Why oh why!!!

ScreenUpdating is one of those application level settings that automatically
resets itself to true when code exectution has ended. There really is no need
to ever reset it to true unless you want the screen to update during code
exectution (pretty rare). So every time you see Application.ScreenUpdating =
True it is for the most part completely un-necessary (I do it as a matter of
habit and good housekeeping, like setting object to nothing when you are done
with then). So now on to your question... In the immediate window when you
execute the line Application.ScreenUpdating = True, it does toggle the
updating but when it has finished the system resets it back again as code
exectution is complete... For the briefest of moments though your
screenupdating was off.
--
HTH...

Jim Thomlinson


"WhytheQ" wrote:

Has anybody ever experienced this before?
Has anybody got a clue how to fix it?

Somehow something has happened to my Excel2003/PC (running on XP) so
that I can go into the Immediate window and run the first line below,
and then if I question what the state of the screenupdating is
immediately afterward I've set it to False I get a result of True !!

Application.ScreenUpdating =False
?Application.ScreenUpdating
True


Any help greatly appreciated,
Regards
Jason.


  #4   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Why oh why!!!

Hi WhytheQ -

Yours is a commonly asked question. Notice that a QuickWatch will display
'True' when ScreenUpdating=False as will hovering the cursor over the
ScreenUpdating keyword when in BreakMode. As merjet and Jim suggest, this
behavior is inconsequential as the value does change per your specifications.
The real proof of whether it is working is if it suppresses updating when
you want it to.

I don't know why, but something internal to the VBA/E environment results in
the behavior you describe. Search for "application.screenupdating = false
not working" for other posts on the same subject. To supplement the code
provided by merjet, here is another procedure (originally provided by Norman
Jones in this DG) that demonstrates that the value of ScreenUpdating truly
does change as expected.

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''
Public Sub TestIt()
Const sStr = "ScreenUpdating is on = "
With Application
.ScreenUpdating = False
MsgBox sStr & .ScreenUpdating
.ScreenUpdating = True
MsgBox sStr & .ScreenUpdating
End With
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''
---
Jay


"WhytheQ" wrote:

Has anybody ever experienced this before?
Has anybody got a clue how to fix it?

Somehow something has happened to my Excel2003/PC (running on XP) so
that I can go into the Immediate window and run the first line below,
and then if I question what the state of the screenupdating is
immediately afterward I've set it to False I get a result of True !!

Application.ScreenUpdating =False
?Application.ScreenUpdating
True


Any help greatly appreciated,
Regards
Jason.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Why oh why!!!

Thanks for all the help.
I suppose the only occassion when it's necessary to tun it back on is
if the code doesn't finish and an error has occured? e.g

'====================
on error goto erroroccured:

code here

erroroccured:
application.screenupdating = true
'====================


.....or isn't the above even necessary?

J




On 17 Apr, 19:10, Jay wrote:
HiWhytheQ-

Yours is a commonly asked question. Notice that a QuickWatch will display
'True' when ScreenUpdating=False as will hovering the cursor over the
ScreenUpdating keyword when in BreakMode. As merjet and Jim suggest, this
behavior is inconsequential as the value does change per your specifications.
The real proof of whether it is working is if it suppresses updating when
you want it to.

I don't know why, but something internal to the VBA/E environment results in
the behavior you describe. Search for "application.screenupdating = false
not working" for other posts on the same subject. To supplement the code
provided by merjet, here is another procedure (originally provided by Norman
Jones in this DG) that demonstrates that the value of ScreenUpdating truly
does change as expected.

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''*'
Public Sub TestIt()
Const sStr = "ScreenUpdating is on = "
With Application
.ScreenUpdating = False
MsgBox sStr & .ScreenUpdating
.ScreenUpdating = True
MsgBox sStr & .ScreenUpdating
End With
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''*'
---
Jay



"WhytheQ" wrote:
Has anybody ever experienced this before?
Has anybody got a clue how to fix it?


Somehow something has happened to my Excel2003/PC (running on XP) so
that I can go into the Immediate window and run the first line below,
and then if I question what the state of the screenupdating is
immediately afterward I've set it to False I get a result of True !!


Application.ScreenUpdating =False
?Application.ScreenUpdating
True


Any help greatly appreciated,
Regards
Jason.- Hide quoted text -


- Show quoted text -





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Why oh why!!!

AFAIK, setting to true is pointless, apart from the sense of documentation:
- If the routines completes, even due to the use of an error handle,
ScreenUpdating is set to True
- If an unhandled error occurs and you enter Break Mode, ScreenUpdating is
set to True

NickHK

"WhytheQ" wrote in message
oups.com...
Thanks for all the help.
I suppose the only occassion when it's necessary to tun it back on is
if the code doesn't finish and an error has occured? e.g

'====================
on error goto erroroccured:

code here

erroroccured:
application.screenupdating = true
'====================


.....or isn't the above even necessary?

J




On 17 Apr, 19:10, Jay wrote:
HiWhytheQ-

Yours is a commonly asked question. Notice that a QuickWatch will display
'True' when ScreenUpdating=False as will hovering the cursor over the
ScreenUpdating keyword when in BreakMode. As merjet and Jim suggest, this
behavior is inconsequential as the value does change per your

specifications.
The real proof of whether it is working is if it suppresses updating when
you want it to.

I don't know why, but something internal to the VBA/E environment results

in
the behavior you describe. Search for "application.screenupdating = false
not working" for other posts on the same subject. To supplement the code
provided by merjet, here is another procedure (originally provided by

Norman
Jones in this DG) that demonstrates that the value of ScreenUpdating truly
does change as expected.


'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''*
'
Public Sub TestIt()
Const sStr = "ScreenUpdating is on = "
With Application
.ScreenUpdating = False
MsgBox sStr & .ScreenUpdating
.ScreenUpdating = True
MsgBox sStr & .ScreenUpdating
End With
End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''*
'
---
Jay



"WhytheQ" wrote:
Has anybody ever experienced this before?
Has anybody got a clue how to fix it?


Somehow something has happened to my Excel2003/PC (running on XP) so
that I can go into the Immediate window and run the first line below,
and then if I question what the state of the screenupdating is
immediately afterward I've set it to False I get a result of True !!


Application.ScreenUpdating =False
?Application.ScreenUpdating
True


Any help greatly appreciated,
Regards
Jason.- Hide quoted text -


- Show quoted text -




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



All times are GMT +1. The time now is 08:50 AM.

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"