title: How do I open an already opened file with a .net StreamReader?
body: <p>I have some .csv files which I'm using as part of a test bench. I can open them and read them without any problems <em>unless</em> I've already got the file open in Excel in which case I get an <code>IOException</code>:</p>
  
  <blockquote>
    <p>System.IO.IOException : The process cannot access the file 'TestData.csv' because it is being used by another process.</p>
  </blockquote>
  
  <p>This is a snippet from the test bench:</p>
  
  <pre><code>using (CsvReader csv = new CsvReader(new StreamReader(new FileStream(fullFilePath, FileMode.Open, FileAccess.Read)), false))
  {
      // Process the file
  }
  </code></pre>
  
  <p>Is this a limitation of StreamReader? I can open the file in other applications (Notepad++ for example) so it can't be an O/S problem. Maybe I need to use some other class? If anyone knows how I can get round this (aside from closing excel!) I'd be very grateful.</p>