View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Kilmer Bob Kilmer is offline
external usenet poster
 
Posts: 280
Default Writing strings to a text file ?

Use Print #

"Dan Thompson" wrote in message
...
This is the code I am using to write strings to a .txt file

Function WriteLineNums()
Dim X as Integer
Dim S As String
S = "Line #"
Open "C:\MyTextFile.txt" For Output As #1
For X = 1 To 3
Write #1, S & X
Next X
Close #1
End Function

The problem is I don't want the function to write the Double quotes to

the
file.
anyhow this is what the function writes to MyTextFile.txt
"Line #1"
"Line #2"
"Line #3"

And This is what I want it to write
Line #1
Line #2
Line #3

What am I doing wrong ?
Any thoughts would be appreciated.

Thanks
Dan Thompson