How to get the *real* PID of a via VBA started asynchronous job !? (in order to monitor and/or stop that job)

louis1-6497 0 Reputation points
2024-09-09T14:54:07.1266667+00:00

I try to start and monitor asynchronous tasks from within MsAccess using VBA. (see question ^Starting applications from MsAccess VBA using shell, can take seconds !!^.

The applications are started using ^PID = Shell("C:\WINDOWS\NOTEPAD.EXE", 1)^ assuming that the returned PID is the PID of in this example is the PID of the NOTEPAD process.

But in the meantime I am not so sure about that any longer See my question VBA shell() does NOT return the expected PID & ^Function CreateProcessA^ crashes Access

So that is quite disappointing, but if the returned PID is not the PID of the ^started process^ it is IMHO almost worthless and I need another way to start an asynchronous process and have the PID or some other unique handle returned which I can use to monitor and eventually kill the started process.

So hopefully someone knows a solution :)

Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
5,197 questions
Access
Access
A family of Microsoft relational database management systems designed for ease of use.
402 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,014 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.