Excel 2003을 사용하고 있습니다. & 매크로에 다음 코드가 있습니다. 내가 이것을 실행하면VBA ReadLine 파일을 읽는 동안 오류가 발생했습니다.
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
은, 내가 이렇게했을 때 그것은 일
"Runtime Error:5"
Invalid Procedure Call or argument at OpenTextFile
상수 ForReading = 1을 정의하십시오. [here] (http://stackoverflow.com/questions/1722196/what-is-dim-fso-myfile-filename-textline-in-vba) 코드를 확인하십시오. – deusxmach1na
@ deusxmach1na : 고맙습니다. 그것은 작동합니다. 내가 그것을 받아 들일 수 있도록 대답으로 넣어주십시오. – logan