Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Writing to a text file.... Help!

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Any idea why this code doesn't work? Gives me an Invalid procedure call or argument runtime error... Am I missing a reference for my project?

    Const ForReading = 1, ForWriting = 2, ForAppending = 3
    Dim fs, f
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.OpenTextFile("c:testfile.log", ForAppending, True, TristateFalse)
    f.Write "Hello world!"
    f.Close

  2. #2
    New Member
    Join Date
    Mar 2002
    Posts
    32
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I believe the value for appending should be 8.

    Doug

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    97
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Good call Doug, thanks a bunch

  4. #4
    Guest

    Default

    I believe ForAppending should be 8 not 3.

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
  •