I am using Excel 2003 & I have following code in my macro.
Dim fs, a, retstring
Set fs = CreateObject("scripting.filesystemobject")
Set a = fs.OpenTextFile("C:\file.txt", ForReading, False)
Do While a.AtEndofStream <> True
retstring = a.ReadLine
Loop
a.Close
When I execute this, it shows
"Runtime Error:5"
Invalid Procedure Call or argument at OpenTextFile