title: Open a PDF using VBA in Excel
body: <p>I'm trying to open all appropriate PDFs found in the same directory as my Excel workbook using VBA.  I've added the Adobe Acrobat xx.x Type Library reference to the project.  But when I try to create the .App object I get a "Run-time error '429':" error.</p>
  
  <p>What am I missing?</p>
  
  <p>Here's the code;</p>
  
  <pre><code>Sub ImportNames()
  Dim BlrInfoFileList() As String, NbrOfFiles As Integer, FileNameStr As String
  Dim X As Integer, pdfApp As AcroApp, pdfDoc As AcroAVDoc
  
  
  'Find all of the Contact Information PDFs
  FileNameStr = Dir(ThisWorkbook.Path &amp; "\*Contact Information.pdf")
  NbrOfFiles = 0
  Do Until FileNameStr = ""
      NbrOfFiles = NbrOfFiles + 1
      ReDim Preserve BlrInfoFileList(NbrOfFiles)
      BlrInfoFileList(NbrOfFiles) = FileNameStr
      FileNameStr = Dir()
  Loop
  
  For X = 1 To NbrOfFiles
      FileNameStr = ThisWorkbook.Path &amp; "\" &amp; BlrInfoFileList(X)
      Set pdfApp = CreateObject("AcroExch.App")
      pdfApp.Hide
  
      Set pdfDoc = CreateObject("AcroExch.AVDoc")
      pdfDoc.Open FileNameStr, vbNormalFocus
  
      SendKeys ("^a")
      SendKeys ("^c")
      SendKeys "%{F4}"
  
      ThisWorkbook.Sheets("Raw Data").Range("A1").Select
      SendKeys ("^v")
      Set pdfApp = Nothing
      Set pdfDoc = Nothing
  
      'Process Raw Data and Clear the sheet for the next PDF Document
  Next X
  End Sub
  </code></pre>