copy folder using IP address as destination path
Hi
I am using Ron de Bruin's code to copy a folder, which works fine when I
specify a drive letter as below. As some of our users have the destination
mapped as various other letters, I'd like to use the IP address of the
destination drive (10.11.70.190) instead. How is this done - my attempts have
only led to error 76, Path not found?
Sub Copy_Folder()
Dim FSO As Object
Dim FromPath As String
Dim ToPath As String
FromPath = "X:\ACCOUNTS-EAST\New MA Project"
ToPath = "S:\TEMA-01"
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
Thanks
Martyn
--
Excel 2000, Windows 2003 over Citrix PS4
|