Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default ScreenUpdating stays TRUE no matter what?

Hi, I have successfully used the "Application.ScreenUpdating = False"
statement in the past, but for some reason it is not working for me
now. Here is my VBA:

Sub calculateEvent()
Dim row As Integer
Dim isBlank As Boolean

'Turn off calculations and screen updating
Application.ScreenUpdating = False
Workbooks("Master.xls").Sheets("CurrentSD").Enable Calculation =
False

'Go through row by row, determine if any SDs are greater than 2
row = 2
isBlank = False
'If SD greater than 2 determine status and take appropriate action
Do While isBlank = False
If Workbooks("Master.xls").Sheets("CurrentSD").Range( "D" &
row).Value = 2 Then
If Workbooks("Master.xls").Sheets("CurrentSD").Range( "E" &
row).Value = "NULL" Then
'CALL openProposal()
End If
If Workbooks("Master.xls").Sheets("CurrentSD").Range( "E" &
row).Value = "OPEN" Then
'Call reopenProposal()
End If
If Workbooks("Master.xls").Sheets("CurrentSD").Range( "E" &
row).Value = "CLOSING" Then
'Call cancelCloseProposal()
End If
End If
'increment row
row = row + 1
If Workbooks("Master.xls").Sheets("CurrentSD").Range( "A" &
row).Value = "" Then isBlank = True
Range("A23").Value = "test"
Loop
'Turn on Calculations and screen updating
Workbooks("Master.xls").Sheets("CurrentSD").Enable Calculation =
True
Application.ScreenUpdating = True
End Sub

If I step through the code and mouseover Application.ScreenUpdating
directly after the "Application.ScreenUpdating = False" statement it
still says "Application.ScreenUpdating = TRUE"?!?!?! Is there some
setting I don't know about that is not letting me turn off screen
updating.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default ScreenUpdating stays TRUE no matter what?

Has anyone ever had this happen where, screenupdating does not change
to false?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ScreenUpdating stays TRUE no matter what?

ScreenUpdating reverts to true when a macro ends

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default ScreenUpdating stays TRUE no matter what?

No, I'm saying that screen updating NEVER changes to false. Right
after the line: Application.ScreenUpdating = False, if I hover over
screenupdating it still says it = true. It is very strange.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ScreenUpdating stays TRUE no matter what?

I've run into problems before, not realizing that at the end of a macro
screen updating reverts to True, but I've never had your problem
before, good luck



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default ScreenUpdating stays TRUE no matter what?

Hi

I get the same thing hovering my mouse over the line, however if I run
the macro the screen does not update until the end so the desired affect
is achieved. If you just run the macro do you see screen flicker?

Regards
Rowan

wrote:
Has anyone ever had this happen where, screenupdating does not change
to false?

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ScreenUpdating stays TRUE no matter what?

It appears you are stepping through your code. Try just running your code.
I would assume when stepping through your code, the screenupdating is set
back to true when the code halts during the step process.

--
Regards,
Tom Ogilvy

wrote in message
oups.com...
No, I'm saying that screen updating NEVER changes to false. Right
after the line: Application.ScreenUpdating = False, if I hover over
screenupdating it still says it = true. It is very strange.



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default ScreenUpdating stays TRUE no matter what?

Thanks so much for your advice. After a little tinkering I have
determined that the screen flickering is caused by the fact that this
procedure is called from a WORKSHEET_CALCULATE() procedure (this code
was originally in the WORKSHEET_CALCULATE procedure, but I moved it
because I thought that might be what was affecting the screenupdating).
And that the flickering actually takes place _after_ the macro has
run. It is hard to tell but I am assuming that the number of flickers
corresponds with the number of times it goes through the DO WHILE loop.
I still think this is strange because there is nothing in this sub
that would cause a calcculation event _to my knowledge_. Does anyone
have any input on this? Is there a way to stop this flickering? Thanks.

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default ScreenUpdating stays TRUE no matter what?

Oh, I should add, that I removed the segment that writes the word
"TEST" to cell A23 which certainly would cause a calculation event

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default ScreenUpdating stays TRUE no matter what?

First off, sorry for my previous convoluted posts and original
question. It is clear to me now that the flicker is being caused by
having this code called from the worksheet calculation event. My
question now is What is causing the calculation event. I think it may
be the if statements checking and comparing values of cells on this
sheet. If that is so, that is unfortunate as I am trying very hard to
have as few calculation events as possible. It also raises the
question of why does't the flicker continue indefinately, if the macro
causes a calc event, and is called when a calc event occurs, and that
is what causes the flicker.

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
Date matter ShamsulZ New Users to Excel 4 October 4th 06 09:54 AM
Function to return True/False if all are validated as True by ISNU Tetsuya Oguma Excel Worksheet Functions 2 March 15th 06 10:28 AM
Screenupdating is always true Petro[_2_] Excel Programming 1 July 23rd 04 04:19 AM
True Or False, no matter what... it still displays the false statement rocky640[_2_] Excel Programming 2 May 13th 04 04:57 PM
ScreenUpdating automatically resets to True Bob Phillips[_5_] Excel Programming 3 August 29th 03 10:58 AM


All times are GMT +1. The time now is 01:52 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"