title: Excel vba On Error GoTo different handlers, depending on an error
body: <p>I have excel vba code that opens different files on makes use of them. An error can occur because there is no file where excel loos for it. I want to create a <code>MsgBox</code> on such errors with a message which specific file is absent. </p>
  
  <p>Now I can only</p>
  
  <pre><code>On Error GoTo ErrorHandler
  
  ErrorHandler:
       MsgBox("File is absent")
  </code></pre>
  
  <p>But I can't specify which exactly file is absent. Is there a way to achieve it through error handler? Maybe through some additional variable?</p>
  
  <p><strong>EDIT</strong>: I open files through</p>
  
  <pre><code>Workbooks.Open Filename:=...
  </code></pre>
  
  <p>But I'm curious about what one should do if the case is</p>
  
  <pre><code>Dim fileTitle As String
  filetitle=Dir()
  </code></pre>
  
  <p>as well.</p>