Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileCopy
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileCopy
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 "Andibevan" wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
FileCopy
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 "Andibevan" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
FileCopy | Excel Programming | |||
FileCopy problem | Excel Programming | |||
FileCopy and read-only | Excel Programming | |||
FileCopy | Excel Programming | |||
FileCopy | Excel Programming |