title: VBA Dir function not working on Excel 2010
body: <p>I mapped an intranet location using the File Explorer. i.e. mapped <a href="http://intranet.XXXXXXX.com/mydir/" rel="nofollow">http://intranet.XXXXXXX.com/mydir/</a> to M:\</p>
  
  <p>I'm using the <code>Dir</code> function to test if a file is present in that location:</p>
  
  <pre><code> Dim FileExists as Boolean
  
   FileExists = Dir("M:\myfile") &lt;&gt; ""
  
   If FileExists Then MsgBox "File found in M:"
  </code></pre>
  
  <p>I run that macro on Excel 2007 and it Works Fine. When I run it on Excel 2010 though, <code>Dir("M:\myfile")</code> always returns "", even if the file is present in the specified location. I can´t find a solution that will work on both Excel versions. Any ideas?</p>