title: VBA Export Excel to PDF
body: <p>I'm getting a '1004' error when running this macro. </p>
  
  <pre><code>Sub macro_PDF()
  
  ActiveSheet.ExportAsFixedFormat _
       Type:=xlTypePDF, _
       FileName:="/Users/username/Desktop/tests/filename.pdf", _
       OpenAfterPublish:=False
  End Sub
  </code></pre>
  
  <p>Image of the Error</p>
  
  <p><a href="https://i.stack.imgur.com/wDraW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wDraW.png" alt="enter image description here"></a></p>
  
  <p>This same code works fine if the name of the file is "PDF.pdf". It seems like I can only export the PDF with the name "PDF.pdf". </p>
  
  <p>The code below returns no errors. Why is this happening?</p>
  
  <pre><code>Sub macro_PDF()
  
  ActiveSheet.ExportAsFixedFormat _
       Type:=xlTypePDF, _
       FileName:="/Users/username/Desktop/tests/pdf.pdf", _
       OpenAfterPublish:=False
  End Sub
  </code></pre>