View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ferris[_2_] Ferris[_2_] is offline
external usenet poster
 
Posts: 34
Default Showing/Hiding shapes

I am experiencing some odd behavior in some of my VBA and I'm hoping
someone can help me out. I have a rectangle on my sheet that I'm
trying to toggle on and off during a long VBA process to let the user
know something is happening in the background. My code is below:

Sub BuildAll()
Call DoIt("Rectangle 1", True) 'Make the updates are in progress
message appear
Application.ScreenUpdating = False
Call BuildSubj
Call BuildAud
Call BuildCert
Call BuildCat
Application.ScreenUpdating = True
Call DoIt("Rectangle 1", False) 'Make it disappear
End Sub

Sub DoIt(ShapeName, Vis)
ActiveSheet.Shapes(ShapeName).Visible = Vis
End Sub


The odd thing is that if I step through the BuildAll (using F8), the
rectangle appears and disappears like I would expect. If I just run
the BuildAll sub the rectangle never appears.

Any thoughts on this?