I am trying to figure out a way to create a simple text file from excel (using VBA). The code below comes close but with a hitch. The stext string seems to need the quotations which presents a problem.

I would like an example of VBA code that can create a text file and pass a string without quotations.

Dim sFile As String
Dim sText As String
Dim iFileNum As Integer

sFile = "C:\(path)\Textfile.txt"

sText = "myString"

iFileNum = FreeFile
Open sFile For Output As iFileNum
Write #iFileNum, sText
Close #iFileNum