Hi All,
I have found the below mentioned code by google to copy the files from a particular location to another :-
But its showing error while I am changing the Frompath: to "https://abc.internal.abc.com/sites/Documents/N4S>" that path does not exists.
Also when I am running same code in local drive its working.
Please suggest if for "http" another code needed ?
Thanks in advance.
Regards,
Rajender
I have found the below mentioned code by google to copy the files from a particular location to another :-
But its showing error while I am changing the Frompath: to "https://abc.internal.abc.com/sites/Documents/N4S>" that path does not exists.
Also when I am running same code in local drive its working.
Please suggest if for "http" another code needed ?
Thanks in advance.
Code:
Sub Copy_Folder()
Dim FSO As Object
Dim FromPath As String
Dim ToPath As String
FromPath = "C:\Users\abc\Desktop\Copy" '<< Change
ToPath = "C:\Users\abc\Desktop\Move" '<< Change
If Right(FromPath, 1) = "\" Then
FromPath = Left(FromPath, Len(FromPath) - 1)
End If
If Right(ToPath, 1) = "\" Then
ToPath = Left(ToPath, Len(ToPath) - 1)
End If
Set FSO = CreateObject("scripting.filesystemobject")
If FSO.FolderExists(FromPath) = False Then
MsgBox FromPath & " doesn't exist"
Exit Sub
End If
FSO.CopyFolder Source:=FromPath, Destination:=ToPath
MsgBox "You can find the files and subfolders from " & FromPath & " in " & ToPath
End Sub
Regards,
Rajender