Copy files-what is wrong with this?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top