Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Application.ScreenUpdating problem

Help!
Can't quite figure out why, but this code doesn't stop the screen from
updating. As it cycles through the For statement, the screen's updating.



Private Sub Workbook_Open()
Dim sh As Worksheet

Application.ScreenUpdating = False

For Each sh In ThisWorkbook.Worksheets
sh.Protect "unlock", , , userinterfaceonly:=True
sh.EnableSelection = xlUnlockedCells
Next sh

Worksheets("DataWorksheet").Visible = False
Worksheets("Information").Activate

'set page up for display
GoToForm

Application.ScreenUpdating = True

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default Application.ScreenUpdating problem

I ran your code and found no screen updating during the run.
However, I was not able to select ANY cells including the unlocked ones.
since your code enables selection AFTER you have locked the sheets.

Moving sh.EnableSelection = xlUnlockedCells
to before the protect command solves this problem.

"jkitzy" wrote:

Help!
Can't quite figure out why, but this code doesn't stop the screen from
updating. As it cycles through the For statement, the screen's updating.



Private Sub Workbook_Open()
Dim sh As Worksheet

Application.ScreenUpdating = False

For Each sh In ThisWorkbook.Worksheets
sh.Protect "unlock", , , userinterfaceonly:=True
sh.EnableSelection = xlUnlockedCells
Next sh

Worksheets("DataWorksheet").Visible = False
Worksheets("Information").Activate

'set page up for display
GoToForm

Application.ScreenUpdating = True

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Application.ScreenUpdating problem

Thanks go. That helped with another problem I was having. I think I may have
found my screen updating problem, too.

I have a sheet_deactivate event on my first page that activates other sheets
and does stuff. I think what was happening was that as those sheets were
activating, they were changing the screenupdating to True. How? Dunno. But, I
put code in that allows me to check to see if the sheet_activate event comes
from another macro and then doesn't perform the sheet_activate event if it
does. Make sense?

"gocush" wrote:

I ran your code and found no screen updating during the run.
However, I was not able to select ANY cells including the unlocked ones.
since your code enables selection AFTER you have locked the sheets.

Moving sh.EnableSelection = xlUnlockedCells
to before the protect command solves this problem.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default Application.ScreenUpdating problem

Happens to me all the time til I insert
Application.EnableEvents=True
to turn off object change events out of the loop temporarily
then reverse the above code.

"jkitzy" wrote:

Thanks go. That helped with another problem I was having. I think I may have
found my screen updating problem, too.

I have a sheet_deactivate event on my first page that activates other sheets
and does stuff. I think what was happening was that as those sheets were
activating, they were changing the screenupdating to True. How? Dunno. But, I
put code in that allows me to check to see if the sheet_activate event comes
from another macro and then doesn't perform the sheet_activate event if it
does. Make sense?

"gocush" wrote:

I ran your code and found no screen updating during the run.
However, I was not able to select ANY cells including the unlocked ones.
since your code enables selection AFTER you have locked the sheets.

Moving sh.EnableSelection = xlUnlockedCells
to before the protect command solves this problem.


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
How to set Application.ScreenUpdating = False for Gen use David_Williams_PG () Excel Discussion (Misc queries) 1 August 15th 06 12:06 PM
Question on application.screenupdating augustus Excel Programming 2 December 18th 04 01:35 AM
Application.screenUpdating = False Pamhall Excel Programming 1 December 17th 04 03:19 PM
problem with Application.ScreenUpdating Betty[_2_] Excel Programming 8 July 23rd 04 09:51 PM
Application.ScreenUpdating = False Pieter Kuyck Excel Programming 2 July 15th 03 06:28 PM


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