Your screenshot suggests the PDFs will have the same names & extensions as the documents. Don't do that! At least your attached workbook has the correct extensions. Try:
Sub CreatePDFs()
'Note: this code requires a reference to the Word object model. See under the VBE's Tools|References.
Application.ScreenUpdating = False
Dim wdApp As New Word.Application, wdDoc As Word.Document
Dim WkSht As Worksheet, r As Long
'Disable any auto macros in the documents being processed
wdApp.WordBasic.DisableAutoMacros
Set WkSht = ActiveSheet
With WkSht
For r = 1 To .UsedRange.Cells.SpecialCells(xlCellTypeLastCell).Row
If Trim(.Range("C" & r).Text) <> "" Then
If Dir(.Range("C" & r).Text, vbNormal) <> "" Then
Set wdDoc = wdApp.Documents.Open(.Range("C" & r).Text, AddToRecentFiles:=False, Visible:=False)
With wdDoc
.SaveAs Filename:=.Range("E" & r).Text, FileFormat:=wdFormatPDF, AddToRecentFiles:=False
.Close SaveChanges:=False
End With
End If
End If
Next
End With
wdApp.Quit
Set wdDoc = Nothing: Set wdApp = Nothing: Set WkSht = Nothing
Application.ScreenUpdating = True
End Sub
Bookmarks