delimiter

H

hughie

Having output text from a dos batch file, I read it back into a text
box on a userform thus:

Open fileName For Input As #1
Do While Not EOF(1)
Input #1, x
str = str & x & vbCrLf
Loop

...and then send 'str' back as the result of a function.

When the file has commas in it, the text box reads them as line breaks.
Does anyone know how to stop this?

tia,
Hughie
 
N

NickHK

Hughie,
Maybe getting the whole file in one go is suitable ?

Dim FileNum As Long
Dim FileStr As String

FileNum = FreeFile
Open "C:\Test.txt" For Input As FileNum
FileStr = Input$(LOF(FileNum), #FileNum)
Close #FileNum

Debug.Print FileStr

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top