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?
Here is the code.
Sub ReadFile()
Infile = ThisWorkbook.Path & "\smallDataset.csv"
Open Infile For Input As #1
Input #1, a, b
Close #1
Debug.Print (a & " " & b)
End Sub
Thanks.