Reputation: 53
I have a Sub that takes some time to process. I want an image that says "Please Wait" to appear on top of the form while processing and then disappear. I have tried this code but it is not working:
Private Sub UserForm_Initialize ()
Image1.visible=False
End Sub
Sub CommandButton1_Click ()
Image1.visible=True
'Here goes the process
Image1.visible=False
End Sub
Is that possible?
Upvotes: 2
Views: 2444
Reputation: 38
Add DoEvents to enable VBA to process the re-paint event
Sub CommandButton1_Click ()
Image1.visible=True
DoEvents
'Here goes the process
Image1.visible=False
End Sub
Upvotes: 1