VBA that uses PDFCreator crashes word after macro practically finishes

At work I’m using Office365. I’m also using PDFCreator with Word macro to merge PDF files from one folder into one PDF file. After macro finishes and succesfully creates merged PDF file (and Word is visible again) I receive the following error: https://imgur.com/a/FOFQi
I think it translates into error: “Microsoft Word has stopped working; Windows is trying to recover your files”; and gives me the option to close Word.

I’ve put stop before and after “job.ConvertTo (outPath)”. First stop goes through, after it stops on second stop and after it performs job.ConvertTo it produces te same error.

How can I solve this problem? This is only one of the steps in a bigger procedure and is not the last step :confused:

Here is the macro:

Sub mergePDF()
Application.Visible = False
Application.DisplayAlerts = False

Dim folder As String
folder = ThisDocument.Path & Application.PathSeparator & “DATA”
If Right(folder, 1) <> “” Then folder = folder & “”
PDFfilename = Dir(folder & “*.pdf”, vbNormal)

Dim outPath$
outPath = ThisDocument.Path & Application.PathSeparator & “ZDRUZENO.pdf”

Dim oPDF As PdfCreatorObj
Set oPDF = New PdfCreatorObj

While Len(PDFfilename) <> 0
    oPDF.AddFileToQueue folder & PDFfilename
    PDFfilename = Dir()  ' Get next matching file

Debug.Print "oPDF isinstancerunning: " & oPDF.IsInstanceRunning ’ close Excel and reopen if true.

On Error GoTo EndSub
Dim q As PDFCreator_COM.Queue
Set q = New PDFCreator_COM.Queue
q.WaitForJobs CountFiles(folder, “*.pdf”), 10

Debug.Print "q.Count: " & q.Count ’ Error-check: here it prints either 1 or 2. Should always be 2.


Dim job As PDFCreator_COM.printJob

While q.Count > 0
Set job = q.NextJob
job.SetProfileByGuid (“DefaultGuid”)
job.ConvertTo (outPath)


Application.Visible = True
Application.DisplayAlerts = True
End Sub


hard to say what the problem is here. Potential problem sources would be initializing or releasing the same queue more than once, but the code doesn’t look like this is happening. Do the VBA examples which get installed together with PDFCreator work properly on your system?

Best regards,



both macros in COM Scripts for Word that haveoutput file as tiff or jpg don’t reproduce the error. All other three macros which have pdf outputs result in crashed word. I assume it would be at the point when job.ConvertTo ends it automatically tries to open created pdf and that kills word. If it is tiff or jpeg, both files are opened after job is done.

So the problem is probably with opening of pdf.


so my troubleshooting found an anwser…
job.SetProfileSetting “OpenViewer”, “false” before job.ConvertTo

thnx robin for pointing me in the right direction xD