View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default message box while macro is running

Wendy,

Don 't know how you can get it to be even t drfiven, but I do know how to
display a MsgBox that will automatically time out after n seconds. This is
that code

Dim nRes As Long
Dim oWSH As Object

Set oWSH = CreateObject("WScript.Shell")
nRes = oWSH.Popup(Text:="Click a button, or just wait ", _
SecondsToWait:=2, _
title:="Automatic MsgBox Timeout", _
Type:=vbYesNoCancel)


The msgbox will timeout after 2 seconds. If the user clicks a button on the
box, it returns vbYes or vbNo, whereas if the msgbox times out, it
returns -1.

I suppose you could set the time to some inordinate length and use SendKeys
to force a Yes or No, but it is getting a bit messy.

I person ally would use a Userform.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"wendy" wrote in message
...
is it possible to have message box pop up when an
auto_open marco calls another macro? Basically, i will
like it to tell the user that the application is running.
and disappears once the marco stops.

example of steps.
1.user click on application
2.application auto_open and run marco
3.message box appear with message "marco is in process"
option for user to click OK(the macro in process is based
on the processing time of the marco that is called by
sub auto_open())
4.second message box "marco has completed" option for
user to click OK (the macro in completed is based on the
completion time of the marco that is called by sub
auto_open())

I have completed step one and two. i need help with the
message box, step 3 and 4
please let me know if i have to create a form
Thanks in advance