A
Adrian
I'm trying to get a VBA macro to write out a text file.
All my attempts have failed - and worryingly the example
in the online VBA help fails in exactly the same manner.
(fails at the Set f= line with run time error 5, invalid
procedure call or argument.)
Any help welcome.
Sub OpenTextFileTest()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Dim fs, f
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("c:\testfile.txt",
ForAppending, TristateFalse)
f.Write "Hello world!"
f.Close
End Sub
All my attempts have failed - and worryingly the example
in the online VBA help fails in exactly the same manner.
(fails at the Set f= line with run time error 5, invalid
procedure call or argument.)
Any help welcome.
Sub OpenTextFileTest()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Dim fs, f
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("c:\testfile.txt",
ForAppending, TristateFalse)
f.Write "Hello world!"
f.Close
End Sub