06-14-2012, 04:35 PM
Name of the file should not be file..as its a keyword.Use some other name.
Try this code
Try this code
Code:
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fsoObj, FileName
Set fso = CreateObject("Scripting.FileSystemObject")
Set FileName = fso.OpenTextFile("D:\bhim\one.txt", ForWriting, True)
FileName.Write "Hello world!"
FileName.Close