Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

msgbox function

Status
Not open for further replies.

ngerman01

Programmer
Oct 2, 2003
10
US
I need to run a macro out of excel that will open a labeling program and then have a message box appear in the labeling program. Also on a side note is there a way to pause vba code for a set amount of time without pause the rest of the computer. I have tried using Application.Wait, but that pause everything else too.

Thanks
 
What is the "Labelling program" you want to run? Is it a VBA sub or a standalone application? If it's in VBA the messagebox should be straightforward, but making a box appear in a standalone app may be difficult or impossible.

Regarding the pause issue: try adding a DoEvents command after a short Application.Wait, and looping them a handful of times. Also read what the help files have to say about the OnTime method.

VBAjedi [swords]
 
Try this code for getting the code to Wait, it's just a timer that waite for 5 seconds, then carrys on the code.

Code:
Private Sub Wait_Click()
Dim tTarget As Date
              
    tTarget = Timer + 5
    Do Until Timer > tTarget
    Loop
    MsgBox "5 Seconds up"
End Sub
 
Are you using the "SHELL" command ?
 
Yes to open the program the shell command is being used
 
Then this FAQ should help you plenty...

faq707-2542

enjoy
 
Also the I am not sure about the if the labeling program is VBA sub. I was told that it was activeX aware, but not really knowing what that means it did not help me. The labeling program itself contains a VBA editor.
 
yes i checked out the faq but the place that i want the program to pause is further down the line from the
shell(ing).
 
then the on time event is what you need...

as muzzery illustrated above
 
Unless your inadvertenly calling a vba function in your shelled process....

then that compounds the problem...

I don't believe that two instances of the vba interpreter will run at the same time.

So you might be forced to add a module to the shelled applications vba function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top