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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Synchronizing a windows program with VBA 1

Status
Not open for further replies.

BuilderSpec

Programmer
Dec 24, 2003
383
GB
Hi

I am trying to find a way that I can execute a windows program from my access database. I have used Shell and mapped ShellExecute but these lack the synchronization.

Is there a way that I can "suspend" the access VBA code from executing until the "shelled" windows program completes?

So in an example

Sub TryIt()
Dim x as integer

x = Shell("RUNPROG.EXE",1)

Msgbox "Complete"
End Sub

I want the "Complete" message to appear when RUNPROG has finished executing..

any ideas gratefully received .. thanks..

Regards

BuilderSpec





Hope this helps!

Regards

BuilderSpec
 
A starting point:
x = CreateObject("WScript.Shell").Run("RUNPROG.EXE", 1, True)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks works a treat..

Hope this helps!

Regards

BuilderSpec
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top