Excel macro - Copy files

Post Reply
wwj
Posts: 2497
Joined: 27 Jan 2007 08:16

Excel macro - Copy files

Post by wwj »

Code: Select all


    Dim fso As Object
    Set fso = VBA.CreateObject("Scripting.FileSystemObject")
    
'   Parameters.
    orgFilePath = ActiveWorkbook.Path & "\pitLake_h3d\"
    filePath = ActiveWorkbook.Path & "\temp\"
    
    inputFile = inputSheet & ".STG"

    If fso.fileexists(orgFilePath & inputFile) Then
        fso.CopyFile (orgFilePath & inputFile), (filePath & inputFile), True
    End If
    
Post Reply