how to wait for a called prog to finish

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

I have a form in an Access 2003 db that calls (using shell - thanks to
this newsgroup) a Vb.net program I wrote to parse a text file. The call
works fine. The VB parses the file correctly.

How do I get the Access form to wait for the VB program to finish? Can
the vb pass code back to Access? Can Access check somehow to see if VB
is closed?

I'm a VB.net newbie.

Thanks in advance.

Jim
 
Hi Jim,

You can Tell Shell to wait, eg:

Dim rtn As Long
rtn = Shell("myexe.exe", , True)

You can also specify a timeout just in case something goes wrong...

rtn = Shell("myexe.exe", , True, 60000)

Regards,

Bill.
 
Unfortunately that shell command doesn't work in VBA. The VBA help for
Shell warns that the calling program will continue to execute while the
"shelled" program may not have finished.

Any other thoughts?

Jim
 
Glad to see you got it working.
Sorry for the bad steer on Shell, I was thinking VB6 and didn't realize VBA
was different on that one.
 
Back
Top