when i use this code to copy a text file and paste it in a specific path:this error a

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ahmed222too
    New Member
    • Sep 2007
    • 47

    when i use this code to copy a text file and paste it in a specific path:this error a

    when i use this code to copy a text file and paste it in a specific path:
    Dim fso As New FileSystemObjec t
    fso.CopyFile "C:\Files\file. txt", "C:\Files1\file _copy.txt"


    this error appear

    compile error
    user-defined type not defined

    is there a specific reference must be defined?
  • VBWheaties
    New Member
    • Feb 2008
    • 145

    #2
    Try

    Code:
    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      ahmed222too, please don't start a new thread when continuing the same discussion. I've closed this one. Please post anything further about this in your original thread.

      Comment

      Working...