Solved

OpenProcess()

Posted on 1997-11-10
1
1,218 Views
Last Modified: 2008-09-30
I want to execute an external applicationvia VBA's shell() command.  I then want to send keystrokes to that application via VBA's Sendkeys() command.  But before continuing past my Sendkeys() commands -- I want the external application to complete (initiated by the last sendkey() which exits the external application)......

after much painful research I have discovered a VB routine called OpenProcess() which seems to allow the user an option as to how to wait (dead wait via WaitForSingleObject() or active wait by testing with GetExitCodeProcess and doing DoEvents if external application still active).  I found all this out in a very good book called "Hard Core Visual Basic".

My Question....
From within my Windows 95 MS Access VBA routine, can I - and if I can - how exactly do I implement OpenProcess() with a flag to choose the active wait option?  I really need to know all the details -- for example, what I need to declare and code in order for my VBA routine to have at  VB routines and pre-defines such as OpenProcess().  Also, please indicate the syntax and usage of OpenProcess() and any other routines or defines that I need to use.

Thanks very much,
Desperately in search of how to make VBA's shell() synchronous
0
Comment
Question by:msaccess
1 Comment
 
LVL 4

Accepted Solution

by:
ozphil earned 100 total points
ID: 1959204
OpenProcess() is not a VB library routine.

To adapt it to your needs i need you to paste the entire code here. Ill then modify it for you.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now