by Selva V Pasupathy
Attribute VB_Name = "Write_or_Append"
Option Explicit
Sub test1()
Call OpenTextFileTest("selva v pasupathy", "myTextFile.txt")
End Sub
Sub OpenTextFileTest(txtString, myfile)
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Dim fs, f As Object, myfilepath As String
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile(ThisWorkbook.Path & "\" & myfile, 8, True)
f.Writeline txtString
f.Close
End Sub
Write or Append a Text File
1 Comment »
Leave a Comment
You must be logged in to post a comment.
Contents of this Site « Selva’s Blog said
[...] Write or Append a Text File [...]