title: Excel Vba "File already open" when its not - windows office
body: <p>I am trying to read data from another spreadsheet in the same folder as my currently opened workbook, whenever I run this code I get the error file already open. Is there something wrong with my syntax or anything that might stop this from happening?</p>
  
  <p>Here is the code.</p>
  
  <pre><code>Sub ReadFile()
      Infile = ThisWorkbook.Path &amp; "\smallDataset.csv"
      Open Infile For Input As #1
          Input #1, a, b
          Close #1
          Debug.Print (a &amp; " " &amp; b)
  End Sub
  </code></pre>
  
  <p>Thanks.</p>