FileCopy

  • Thread starter Thread starter Andibevan
  • Start date Start date
A

Andibevan

Hi All,

Why does the following code not work it gets an error Run-Time error '450'
"Wrong number of arguments or invalid property assignemnt".?

Sub copy_copy
Set FS = CreateObject("Scripting.filesystemobject")

FS.copyfolder.copyfolder "S:\temp_Start\*", "E:\Test\"

End Sub

Thanks

Andi
 
I tried the following code and it worked

Sub Test()
Dim fs As New FileSystemObject
fs.CopyFolder "C:\Temp1", "c:\Temp2"
End Sub

Please note that C:\Temp1 should already be there. C:\Temp2 will be created.
Also when looking at the FileExplorer to check if the folder has been
created, press the F5 key to refresh the list of folders/files.

Alok Joshi
 
Try something like

Dim FSO As Object
Set FSO = CreateObject("Scripting.FileSystemObject","")
FSO.CopyFolder "H:\Temp\*.*", "H:\Temp2"
FSO.CopyFile "H:\Temp\*.*", "H:\Temp2"



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

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