title: Excel - Error 400 for SaveAs operation
body: <p>So I am new to Excel VBA stuff and I have a problem here...</p>
  
  <p>My code is as follows..</p>
  
  <pre><code>Sub Export()
  
  Dim FileName As String
  Dim Path As String
  Path = "~/Desktop"
  FileName = Range("B4").Value &amp; ".pdf"
  
  ActiveWorkbook.SaveAs Path &amp; FileName
  End Sub
  </code></pre>
  
  <p>and what I am trying to do is to get a value from the string <code>B4</code> (the filename) and try to export the file in <code>.pdf</code> format. Unfortunately, it doesn't work. Please help!</p>