title: Edit to file renaming VBA to fix runtime error: file not found
body: <p>Through some research and trial and error, I was able to come across this basic VBA that is helping me rename a large list of file attachments. I have been able to rename a few dozen attachments but I run into the run-time error '53: File Not Found.' Is there a way to modify the VBA to skip over the file names that cannot be found?</p>
  
  <pre><code>Sub RenameFiles()
  Const strPath = "C:\Documents and Settings\User\My Documents\FolderName\"
  Dim r As Long
  Dim n As Long
  n = Cells(Rows.Count, 1).End(xlUp).Row
  For r = 2 To n
  Name strPath &amp; Cells(r, 1) As strPath &amp; Cells(r, 2)
  Next r
  End Sub
  </code></pre>