View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Cesar Zapata[_2_] Cesar Zapata[_2_] is offline
external usenet poster
 
Posts: 66
Default How to display a message box

The best way I have found is this. Put a Image in your worksheet. and name
it Please Wait or whatever. the run this code. The way I usually do it is
I create a Userform with all the stuff I want the I take a screenshot and
paste it in my worksheet.


Dim MySel As Object




Sub Show_Please_Wait()

On Error Resume Next

Dim VR As Range, MyShape As Shape
Set VR = ActiveWindow.VisibleRange
Set MyShape = Sheet1.Shapes("PleaseWait")
Set MySel = Selection

MyShape.Copy
T = VR.Top + VR.Height / 2 - MyShape.Height / 2
L = VR.Left + VR.Width / 2 - MyShape.Width / 2

ActiveSheet.Paste
With ActiveSheet.Shapes("PleaseWait")
.Top = T
.Left = L
End With

VR.Resize(1, 1).Select

End Sub

Sub Hide_Please_Wait()

On Error Resume Next
ActiveSheet.Shapes("PleaseWait").Delete
Application.ScreenUpdating = True
MySel.Select
End Sub







"Salman" wrote in message
...
I need to have a message box that says "Please wait" show
up while code executes. Used to be a simple thing in XL97.
Please tell me how to make it show up.

Thank you.