Sub
copyFile()
Dim
objFSO
As
Object
Dim
strFileToCopy, strOldPath
As
String
, strNewPath
As
String
strOldPath = "C:\Masterwood\"
strNewPath = "E:\bearbeitet\"
With
ActiveSheet
strFileToCopy = .Range(
"A1"
)
strFileToCopy = strFileToCopy &
".prg"
If
Dir(strOldPath & strFileToCopy, vbNormal) <>
""
Then
Set
objFSO = CreateObject(
"Scripting.FileSystemObject"
)
objFSO.copyFile strOldPath & strFileToCopy, strNewPath & strFileToCopy
End
If
End
With
Set
objFSO =
Nothing
End
Sub