View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Alex St-Pierre Alex St-Pierre is offline
external usenet poster
 
Posts: 169
Default Screen refresh problem

No, it doesnt' work with application.screenupdating=false.

Since it's only one sheet that have the problem, maybe, the only thing I
see is:
1) Same thing happens with another computer
2) Can it be a variable Set abc = that is not reset at the end? (no global
variable is used) When I close the file, I thought all variable or object
information are lost).
3) I use Image in each sheets that execute a macro when you click on it.
(Image_1_Click(), Image_2_Click()). I had this programmation for a while
without having problem.
4) There's no hidden row or column.

I think the only solution is to copy the file and try to find the solution
by 1) remove all the macros from the file 2) Remove image, 3)Remove other
sheets, etc. until it works!

--
Alex St-Pierre


"Don Guillett" wrote:

I would have written the code a bit differently but

try
application.screenupdating=false
code
application.screenupdating=true

Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alex St-Pierre" wrote in message
...
No, it's not a change_event macro. I found a part of the problem.
When I open the document, all work fine. I can delete a sheet without
having
screen updating problem. Then, after running abc, if I delete a sheet or
change a value, I see the same thing (part of the content of an other
sheet).
Do you have an idea?
Thank you!
Alex
Sub abc()
Call ProtectSheet(False)
Call ProtectSheet(True)
End Sub
Sub ProtectSheet(bValue As Boolean)
If bValue = True Then
ThisWorkbook.sheets("data").Protect DrawingObjects:=True,
Contents:=True, Scenarios:=True
ThisWorkbook.sheets("A-1").Protect DrawingObjects:=True,
Contents:=True, Scenarios:=True
ThisWorkbook.sheets("A-2").Protect DrawingObjects:=True,
Contents:=True, Scenarios:=True
ThisWorkbook.sheets("A-3").Protect DrawingObjects:=True,
Contents:=True, Scenarios:=True
ThisWorkbook.sheets("A-4").Protect DrawingObjects:=True,
Contents:=True, Scenarios:=True
ThisWorkbook.sheets("A-5").Protect DrawingObjects:=True,
Contents:=True, Scenarios:=True
ThisWorkbook.sheets("A-6").Protect DrawingObjects:=True,
Contents:=True, Scenarios:=True
ThisWorkbook.sheets("A-7").Protect DrawingObjects:=True,
Contents:=True, Scenarios:=True
Else
ThisWorkbook.sheets("data").Unprotect
ThisWorkbook.sheets("A-1").Unprotect
ThisWorkbook.sheets("A-2").Unprotect
ThisWorkbook.sheets("A-3").Unprotect
ThisWorkbook.sheets("A-4").Unprotect
ThisWorkbook.sheets("A-5").Unprotect
ThisWorkbook.sheets("A-6").Unprotect
ThisWorkbook.sheets("A-7").Unprotect
End If
End Sub

--
Alex St-Pierre


"Don Guillett" wrote:


A poorly designed change_event??

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alex St-Pierre" wrote in
message
...
Hi!
When I change a value inside a worksheet, I see the contents of an
other
sheet inside the activesheet. Then, when I scroll with the mouse, it
disapears. Does anyone have an idea?
Thank you!
--
Alex St-Pierre

.


.