title: Why does Excel Give a "Compile error: Syntax error" When I run the macro
body: <p>I am trying to create a print to PDF Macro for a worksheet that uses a drop down list. I want each option in the drop down list to be saved as its own PDF.</p>
  
  <p>This is my code:</p>
  
  <pre><code>Sub Print_To_PDF()
  Sheets("MS Wall Summary Daily View").Activate
      Dim vRws As Long, vRng As Range
      Dim d As Range, d8 As Range, Wst As Worksheet
      Dim fPathFile As String
  
  fPathFile = [NewStoreRollout]
  Set Wst = Worksheets("MS Wall Summary Daily View")
  Set d8 = Wst.Range("D8")
  
  With Wst
      vRws = .Cells(Rows.Count, "A").End(x1Up).Row
      Set vRng = Range(.Cells(2, "A"), .Cells(vRws, "A"))
      .PageSetup.PrintArea = "$C$2:$M$116"
  
  End With
  For Each d In vRng.Cells
  
  d8 = d
  Wst.ExportAsFixedFormat Type:=xlTypePDF, Filename:=fPathFile,
  Quality:=xlQualityStandard, _IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
  
  Next d
  End Sub
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/39edM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/39edM.png" alt="enter image description here"></a></p>
  
  <p>My Drop down starts in A1, though I want the PDFs starting in A2. The cell with the dropdown list is d8</p>
  
  <p><a href="https://i.stack.imgur.com/Ymqm9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ymqm9.png" alt="enter image description here"></a></p>
  
  <p>The Cell named "NewStoreRollout" contains my filepath that I want the PDfs saved to.</p>
  
  <p>Thanks</p>