View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default copying folder contents

Hi jnewl

Try this to copy from C:\Data\*.* to C:\Paste

Sub test()
Dim objShell, objFolder
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Paste")

If (Not objFolder Is Nothing) Then
objFolder.CopyHere ("C:\Data\*.*")
End If

End Sub


--
Regards Ron De Bruin
http://www.rondebruin.nl



"jnewl" wrote in message ...
i based the following code on an example from copy files to other folder,
recorded march 31, 2006

Sub copyfolder_con()
Dim strfom, strto As String
Dim copyinfo As Object

strfrom = "w:\adhoc \ ipa profiles \ 2006 \ power play reports for ipas \
nnyppo power play reports\ *.xls"
MsgBox strfrom
strto = "w:\adhoc \ ipa profiles \ 2006 \ test area"
MsgBox strto
Set copyinfo = CreateObject("scripting.FileSystemObject")

copyinfo.copyfile strfrom, strto, False

End Sub


strfrom and strto have valid values.

it always abends at the copyinfo.copyfile statement.

yet this is exactly what is in help and what was on for march 31.

so why the abends?

thanks