title: Word Document created does not convert to PDF
body: <p>Generated Word Document does not convert to PDF</p>
  
  <p>I generate a Word Document populating the bookmarks within it from excel and then tried exporting to PDF. Constantly getting error even after adding Microsoft Word Library 16.0. What am I doing wrong here?</p>
  
  <p>Option Explicit</p>
  
  <pre><code>Sub GenerateTerminationLetter()
  
      Dim objWord As Object, docWord As Object
      Dim wb As Workbook
      Dim xlName As Name
      Dim Path, SavePath, TempPath, FileName3 As String
      Dim EmpFileName As String
  
  
          Set wb = ThisWorkbook
  
      ' ******************************* Primary Letter Template Location ***********************
      Sheets("FilePath").Select
          TempPath = Sheets("FilePath").Range("C16").Value
              If Right(TempPath, 1) &lt;&gt; "\" Then
                      TempPath = TempPath &amp; "\"
                  Else
              End If
          Path = TempPath &amp; "Termination Letter (Redundancy A023 FPP) (NEW - With Whistle Blowing Statement).docx"
  
      '*******************************Populate Bookmarks ***************************************
      On Error GoTo ErrorHandler
       'Create a new Word Session
                  Set objWord = CreateObject("Word.Application")
       'Open document in word
                  Set docWord = objWord.Documents.Add(Path)
       'Loop through names in the activeworkbook
      For Each xlName In wb.Names
           'if xlName's name exists in the document then put the value at the bookmark
          If docWord.Bookmarks.Exists(xlName.Name) Then
              docWord.Bookmarks(xlName.Name).Range.Text = Range(xlName.Value)
          End If
      Next xlName
      Sheets("Temp").Visible = xlVeryHidden
  
      '******************************* Activate word and display document **********************
  
      With objWord
          .Visible = True
          .Activate
      End With
      'Save Termination Letter
      FileName3 = Sheets("R-Copy").Range("D7").Value
      '******************************* Export as PDF ********************************************
      docWord.ExportAsFixedFormat _
      Type:=xlTypePDF, _
      Filename:=EmpFolder &amp; "\" &amp; "Termination Letter_" &amp; FileName3, _
      Quality:=xlQualityStandard, _
      IncludeDocProperties:=True, _
      ExportFormat:=wdExportFormatPDF
  
  
      objWord.Quit
      'Release the Word object to save memory and exit macro
  
      ErrorExit:
                  Set objWord = Nothing
                  Exit Sub
  
      'Error Handling routine
  
  
      ErrorHandler:
  
         If Err Then
            MsgBox "Error No: " &amp; Err.Number &amp; "; There is a problem. Contact Administrator"
               If Not objWord Is Nothing Then objWord.Quit False
                  Resume ErrorExit
         End If
      End Sub
  </code></pre>
  
  <p>Error No. 448: Contact Administrator</p>