I'm using this code below...
Declare Sub Sleep Lib "kernel32" (ByVal Milliseconds As Long)
Sub blink()
Sleep 500
ActiveSheet.Shapes("the_shape").Visible = False
Sleep 500
ActiveSheet.Shapes("the_shape").Visible = True
End Sub
am I missing something?
That is pretty strange. Adding DoEvents
resolved the problem. I'm guessing that Sleep
is pausing the thread before Excel has a chance to hide the shape.
Declare Sub Sleep Lib "kernel32" (ByVal Milliseconds As Long)
Sub blink()
Sleep 500
ActiveSheet.Shapes("the_shape").Visible = False
DoEvents
Sleep 500
ActiveSheet.Shapes("the_shape").Visible = True
End Sub