We help IT Professionals succeed at work.

file reader syntax not working

Fordraiders
Fordraiders asked
on
vba.

I'm trying to append text file, but cant get this to work ?
This:
Set writeFile = objFSO.OpenTextFile(TextBox3.Text, ForWriting, True) '<--outgoing file
To This ?:
Set writeFile = objFSO.OpenTextFile(TextBox3.Text, Forappending, True) '<--outgoing file


Thanks
fordraiders
Comment
Watch Question

what error you are getting

    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.OpenTextFile("c:\testfile.txt", ForAppending,TristateFalse)

Open in new window


check this link also

https://msdn.microsoft.com/en-us/library/aa265347(v=vs.60).aspx

Author

Commented:
yes, read all that from the link already.

I had:
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set writeFile = objFSO.OpenTextFile(TextBox3.Text, ForAppending, TristateFalse) '<--outgoing file

Invalid procedure call or argument

Author

Commented:
ok set "microsoft scripting runtime" and worked.