Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: write to text file without quotes in VBA

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Sample code

    Open "C:myfile.txt" For Output As #1 Len = 120
    record = "Message1"
    Write #1, record
    record = "Message2"
    Write #1, record

    Is there a way of not having quotation marks in the file?

  2. #2
    Board Regular
    Join Date
    Apr 2002
    Posts
    115
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try the 'print' command instead of the 'write' command. Also, it's best to close your file.

    Sub Print_Test()
    Dim record As String
    Open "C:myfile.txt" For Output As #1
    record = "Message1"
    Print #1, record
    record = "Message2"
    Print #1, record
    Close #1
    End Sub

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •