View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
RG III RG III is offline
external usenet poster
 
Posts: 65
Default Error during file read?


This works as expected...

Sub ParseTextFile2()
Dim vTmp
Const sLine$ = "a123 Go now 123"
vTmp = Split(Application.Substitute(sLine, " ", "*", 1), "*")
Debug.Print Trim(vTmp(1))
End Sub


Yes! That one worked, but...


..and so does this...

Sub ParseTextFile2()
Dim vTmp, sLine$
Const sFile$ = "C:\Data.txt"
sLine = ReadTextFile(sFile)
vTmp = Split(Application.Substitute(sLine, " ", "*", 1), "*")
Debug.Print Trim(vTmp(1))
End Sub


This one still doesn't work. I've done experiments with
various file reading functions, including ReadTextFile(),
but they just aren't working. Also, I prefer not to
dump the array onto a new sheet.

I'm going to try to approach this another way. I'll be back soon.