title: Macro to pick Excel Save As location based on cell value is giving runtime error 1004
body: <p>Here is my code</p>
  
  <pre><code>Public Sub SaveAsA1()
  
  With Application.FileDialog(msoFileDialogSaveAs)
  .InitialFileName = ActiveWorkbook.Sheets("Sheet1").Range("R1").Value
  .Show
  ActiveWorkbook.SaveAs filename:=Range("R1") &amp; ".xlsm", FileFormat:=52
  
  End With
   MsgBox "File Saved!"
  End Sub
  </code></pre>
  
  <p>but when I choose a location it does not over-write the cell value and it give a runtime error #1004.</p>
  
  <p>Please can anybody help?</p>