Hi All,
I am having an issue implementing the FileSystemObject in a piece of code and wondered if anyone could help....!
The code I am successful with is:
Dim fso
Set fso = CreateObject("scripting.filesystemobject")
fso.copyfile "C:\Users\Me\Folder\file1.pdf" , "C:\Users\Me\Folder\Archived\file2.pdf"
However when I try and use this code as an alternative it falls over with a 'Run-time Error 5
Dim fso
Dim Filename
Dim Sourcename
Set fso = CreateObject("scripting.filesystemobject")
Set Filename = Me.Sheets("sheet1").Cells("A1") 'this cell contains the same path as file1 above
Set Sourcename = Me.Sheets("sheet1").Cells("A2") 'this cell contains the same path as file2 above
fso.copyfile Filename , Sourcename
Bookmarks