I was previously using PDF creator 1.7 with MS Access VBA script. To detect if the another instance was running I used.
Do
bPDFRestart = False
Set PDFjob = New PdfCreatorObj
'PDF Creator is already running. Kill the existing process
If PDFjob.cStart("/NoProcessingAtStartup") = False Then
Shell "taskkill /f /im PDFCreator.exe", vbHide
DoEvents
Set PDFjob = Nothing
bPDFRestart = True
End If
Loop Until bPDFRestart = False
But recently I have upgraded to PDF Creator 2.3.2 so that I can install the same version on all the machines that will be using the database. I have been through the documentation and now check to see if the if another instance is running using the following
iCount = 0
Do
MsgBox iCount
bPDFRestart = False
Set PDFObj = CreateObject(“PDFCreator.PDFCreatorObj”)
'PDF Creator is already running. Kill the existing process
If PDFObj.IsInstanceRunning = True Then
Shell "taskkill /f /im creator-ws.exe", vbHide
DoEvents
Shell "taskkill /f /im crash-handler-ws.exe", vbHide
DoEvents
Set PDFObj = Nothing
bPDFRestart = True
End If
iCount = iCount + 1
Loop Until bPDFRestart = False Or iCount = 10
Bu this does not seem to shutdown the instances of PDF creator and loops through 10 times before I stop the process.
I have used task manager to try to find the running instances and can only find running services. Is there an easier way to do this?