473,387 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to wait for a called prog to finish

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
Aug 9 '07 #1
5 6135
Jim,

This one should do it. (WaitForExit)

http://msdn2.microsoft.com/en-us/lib...itforexit.aspx

Cor

"Jim" <jo********@RemoveThisStuffNetscape.netschreef in bericht
news:1d******************************@massilloncab letv.com...
>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
Aug 9 '07 #2
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.
"Jim" <jo********@RemoveThisStuffNetscape.netwrote in message
news:1d******************************@massilloncab letv.com...
>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
Aug 9 '07 #3
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
>
"Jim" <jo********@RemoveThisStuffNetscape.netwrote in message
news:1d******************************@massilloncab letv.com...
>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
Bill McCarthy wrote:
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.
Aug 9 '07 #4
Jim
Guilty of not looking for myself. See:

vbnet.mvps.org/index.html?code/faq/getexitcprocess.htm

or

www.mvps.org/access/api/api0004.htm

Jim

Jim wrote:
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
>>
"Jim" <jo********@RemoveThisStuffNetscape.netwrote in message
news:1d******************************@massillonca bletv.com...
>>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
Bill McCarthy wrote:
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.
Aug 9 '07 #5
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.
"Jim" <jo********@RemoveThisStuffNetscape.netwrote in message
news:So******************************@massilloncab letv.com...
Guilty of not looking for myself. See:

vbnet.mvps.org/index.html?code/faq/getexitcprocess.htm

or

www.mvps.org/access/api/api0004.htm

Jim

Jim wrote:
>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
>>>
"Jim" <jo********@RemoveThisStuffNetscape.netwrote in message
news:1d******************************@massillonc abletv.com...
>>>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
Bill McCarthy wrote:
> 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.
Aug 9 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Roger Down | last post by:
Lets say I have a method UpdateCache() called from a single thread. I also have a method GetCache() called from multiple threads. When UpdateCache() is called, the cache updating is being...
3
by: Matt C. | last post by:
This is my first attempt at writing a .NET service, and also my first attempt at using threads. I don't know what I'm doing. Below is some simplified code from my service class (inheriting from...
2
by: Jordan S | last post by:
I have written a small Console application that executes the following line, amongst other things: System.Diagnostics.Process.Start(currentWorkingDirectory + @"\backup_files.cmd"); My Console...
11
by: Peter Kirk | last post by:
Hi there I am looking at using a thread-pool, for example one written by Jon Skeet (http://www.yoda.arachsys.com/csharp/miscutil/). Can anyone tell me if this pool provides the possibility to...
4
by: Mohsen Aghazadeh | last post by:
In my application I wait for a shelled application to finish and continue to work. Everything works fine but when the shelled program is up and user tries to open other applications (outside of my...
4
by: Prasad | last post by:
Hello, I have two threads T1 and T2. T2 starts thread T1 and waits for 1 minute for T1 to finish (using Join) and if it doesn't finish within that time, it aborts the thread T1. Now, I...
18
by: Coder | last post by:
Howdy everybody! How do I do the following... while (myVary != true){}; Obviously I do not want to use 100% of the processor to stay in this infinite loop till myVar == true. But wait do I...
5
by: Deepak | last post by:
I am programing a ping application which pings various centers . I used timer loop and it pings one by one. Now when i finish pinging one center it should wait for the ping_completed function to...
10
by: ImortalSorrow | last post by:
Hey, I hope you can help me with a prog i'm making. Everything is working well except a part where i want to repeat the riddle if the answer isnt correct. here's the bit of the bode where i need help...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.