下面的代码读取文本文件,运行至ReadLine时出错“输入超出文件尾”。
如何解决?Sub a()
Const ForReading = 1
Dim fs, f
Dim sLine As String
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("c:\CharCode.dat", ForReading, 0)
sLine = f.readline
f.Close
End Sub
如何解决?Sub a()
Const ForReading = 1
Dim fs, f
Dim sLine As String
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("c:\CharCode.dat", ForReading, 0)
sLine = f.readline
f.Close
End Sub
loop或者你的文件中没数据