title: How to print pdf files in order of cell list using Excel-VBA?
body: <p>I cannot figure out how I can print PDF files in order (order of cell list).</p>
  
  <pre><code>Sub PrintPDFFiles() 
      zProg = "C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe" 
      zLastRow = [a65536].End(xlUp).Row 
      temp = "a1:a" &amp; zLastRow 
      zPrinter = "HP LaserJet Professional M1213nf MFP " 
      For Each cell In Range(temp) 
      zFile = cell.Value 
      If zFile Like "*.pdf" Then 
      Shell """" &amp; zProg &amp; """/n /h /t""" &amp; zFile &amp; """" 
      End If 
      Next 
      End Sub
  </code></pre>
  
  <p><strong>Visual Aid:</strong>
  <a href="https://i.stack.imgur.com/bsNPW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bsNPW.png" alt="enter image description here"></a></p>
  
  <p><strong>Research I have done so far:</strong></p>
  
  <p>No command line <a href="https://stackoverflow.com/questions/619158/adobe-reader-command-line-reference">switch</a> to print files in order.</p>
  
  <p><strong>Update-1 MyCode After Suggestions:</strong></p>
  
  <p>I used object.run method in my code and I get error:</p>
  
  <pre><code>Sub PrintPDFFiles() 
      zProg = "C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe" 
      zLastRow = [a65536].End(xlUp).Row 
      temp = "a1:a" &amp; zLastRow 
      zPrinter = "HP LaserJet Professional M1213nf MFP " 
      For Each cell In Range(temp) 
      zFile = cell.Value 
      If zFile Like "*.pdf" Then 
      Dim wsh As Object
      Set wsh = VBA.CreateObject("WScript.Shell")
      Dim waitOnReturn As Boolean: waitOnReturn = True
      Dim windowStyle As Integer: windowStyle = 1
      zCommand = zProg &amp; " /n /h /t " &amp; Chr(34) &amp; zFile &amp; Chr(34) &amp; " " &amp; zPrinter
      wsh.Run zCommand, windowStyle, waitOnReturn
      End If 
      Next 
      End Sub
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Hf5Ib.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hf5Ib.png" alt="Error"></a></p>
  
  <p><strong>Update-2 My code After Suggestions:</strong></p>
  
  <pre><code>wsh.Run """Acrobat.exe"" /n /h /t" &amp; Chr(34) &amp; zfile &amp; Chr(34) &amp; " " &amp; zPrinter, , waitOnReturn
  </code></pre>
  
  <p><strong>Problem:</strong>
  I managed to print using run method , however I have to close Adobe Acrobat Reader after each file. I have to print 500+ files.</p>