ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy files-what is wrong with this? (https://www.excelbanter.com/excel-programming/320718-copy-files-what-wrong.html)

Vlad

Copy files-what is wrong with this?
 
What is wrong with this

Sub Copy_FIles ()
Dim fPath as string, lPath as string

fPath = "\\tfmafs01\corporatesecure$\Procurement
Reporting\ExportReportFolder\Working\"
lPath = "\\tfmafs01\corporatesecure$\Procurement
Reporting\ExportReportFolder\Working\Pre_Formatted _Backup"

FileCopy fPath & "*.*", lPath & "*.*"
End Sub

Thanks

Ken Macksey

Copy files-what is wrong with this?
 
Hi

Use a msgbox to see if your paths are correct before you copy it, something
like this. When you get it right, rem out the message box and remove the rem
from the file copy command.

Dim fPath As String, lPath As String

fPath =
"C:\tfmafs01\corporatesecure$\ProcurementReporting \ExportReportFolder\Working\"
lPath =
"C:\tfmafs01\corporatesecure$\ProcurementReporting \ExportReportFolder\Working\Pre_Formatted_Backup"


MsgBox fPath & "*.*" & "," & lPath


'FileCopy fPath & "*.*", lPath

HTH

Ken




All times are GMT +1. The time now is 01:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com