title: Exporting a range of cells in Excel to Word and saving the Word document as both a Word-file AND a PDF-file
body: <p><strong>What I am trying to do:</strong>
  Export a range of cells from an Excel worksheet as an image in an existing Word document, and then saving this Word document as both a Word document and a PDF file. The name both the Word file and the PDF file should get, is in a cell in the Excel worksheet.</p>
  
  <p><strong>The problem:</strong>
  Almost everything works, except for the .pdf-file. It is generated, but when trying to open it I get an error, saying the file is unreadable.</p>
  
  <p>Can someone help with this? The code I use is below - I assembled it from different examples on this and other forums (I really am a VBA beginner)...</p>
  
  <p>Thank you so much!</p>
  
  <p><strong>The Code:</strong></p>
  
  <pre><code>Sub SaveAsWord()
  
  Dim WordApp As Object
  Set WordApp = CreateObject("Word.Application")
  
  Dim WordDoc As Object
  Set WordDoc = WordApp.Documents.Open("C:\Users\Jurgen\Documents\remake.docx")
  
  Range("C4:E19").Select
  Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
  WordApp.Visible = True
  WordApp.ActiveDocument.Bookmarks("here").Select
  Set objSelection = WordApp.Selection
  objSelection.Paste
  
  Dim myfilename As String
  myfilename = Sheets("Blad1").Range("G15")
  WordApp.ActiveDocument.SaveAs2 Filename:="C:\Users\Jurgen\Documents\" &amp; myfilename &amp; ".pdf", _
  FileFormat:=wdFormatPDF
  WordApp.ActiveDocument.SaveAs2 Filename:="C:\Users\Jurgen\Documents\" &amp; myfilename &amp; ".docx", _
  FileFormat:=wdFormatXMLDocument
  
  End Sub
  </code></pre>