how to wait for a called prog to finish

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
 
B

Bill McCarthy

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.
 
J

Jim

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
 
B

Bill McCarthy

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top