Is MS Project running?

D

Dan

Maybe it is easy to answer this question - but how I can decide that MS
Project is runing?
I have application which communicate with MS Project through OLE. But
because I use special global mpt, at the beginning of this action
(communication whit MSP) I start winproj.exe with this global. Another step
is connect to this running OLE server. But for time to time there is some
problem. And I don't know how to decide winproj.exe started and OLE server
is working and waiting for connection. How can I decide if is MSP OLE server
works? Or may be some different problem there?
Thank you for answer

Dan
 
R

Rick Williams

You can use error-trapping and GetObject to find out.
Like

On Error Resume Next
set appProj=GetObject(,"MSProject.Application")
if Err.Number>0 then
err.clear
set appProj=CreateObject("MSProject.Application")
end if
On Error Goto 0

Hope this helps,
Rick Williams
 

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