i want to make a copy of a file to a new folder.
but i get a "Permission denied" error.
(1)
FileCopy sFolder & "Site Safety Metrics Rollup.xlsm", _
sNewFolder & "Site Safety Metrics Rollup.xlsm"
this also gives an error:
(2)
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile sFolder & "Site Safety Metrics Rollup.xlsm", sNewFolder & "Site Safety Metrics Rollup.xlsm"
but this works(after adding the library)
(3)
Dim FSObj As FileSystemObject
Set FSObj = New FileSystemObject
FSObj.CopyFile sFolder & "Site Safety Metrics Rollup.xlsm", _
sNewFolder & "Site Safety Metrics Rollup.xlsm", True
can i do anything in order to use (1)?
just because i am also 'moving' files which also deletes the old file
and there is just the one file that i wanty to 'copy' without deleting.
Name sFolder & "TFP EHS Metrics Presentation.potx" _
As sNewFolder & "TFP EHS Metrics Presentation.potx"
hmmm, maybe just do a "SaveAs" to the new folder.
but i get a "Permission denied" error.
(1)
FileCopy sFolder & "Site Safety Metrics Rollup.xlsm", _
sNewFolder & "Site Safety Metrics Rollup.xlsm"
this also gives an error:
(2)
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile sFolder & "Site Safety Metrics Rollup.xlsm", sNewFolder & "Site Safety Metrics Rollup.xlsm"
but this works(after adding the library)
(3)
Dim FSObj As FileSystemObject
Set FSObj = New FileSystemObject
FSObj.CopyFile sFolder & "Site Safety Metrics Rollup.xlsm", _
sNewFolder & "Site Safety Metrics Rollup.xlsm", True
can i do anything in order to use (1)?
just because i am also 'moving' files which also deletes the old file
and there is just the one file that i wanty to 'copy' without deleting.
Name sFolder & "TFP EHS Metrics Presentation.potx" _
As sNewFolder & "TFP EHS Metrics Presentation.potx"
hmmm, maybe just do a "SaveAs" to the new folder.