PDF not saving, Word gets stuck "in_wordDoc.SaveAs(in_fullOutputPathPdf, WdExportFormat.wdExportFormatPDF)"

Hi all!

So, I’m working in a process where it reads a excel sheet, put it in a word document, then saves the word document and converts do PDF.
I’m using VBnet, sometimes it works, sometimes it freezes the word and the process gets a timeout.

I’m using these lines:

in_wordDoc.saveAs(in_fullOutputPath)
in_wordDoc.SaveAs(in_fullOutputPathPdf, WdExportFormat.wdExportFormatPDF)

I put a delay betwenn then to make it work “sometimes”.

Something that gets me is that when I’m running it in attended mode, I can see that when it tries to save as PDF (In this case, export, both get the same issue), it shows in the left lower corner of word “Connecting to Print. Pess Esc to Cancel”. And if I press Esc it goes in… 3~5 seconds do export and close the application, if I left (How it would be in unattended mode), it takes 30 seconds (more or less), but because of that, sometimes it freezes. Tries to access the path to the file it just saved in word.

Anyone have had trouble with this?