LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change link path when open destination file AskExcel Excel Worksheet Functions 1 March 30th 09 05:54 PM
Remove end folder from path found with ThisWorkbook.Path command ? dim Excel Programming 9 April 23rd 08 06:04 AM
How to List the names of the subfolders present in the folder (path of folder is given in the textbox by user ) divya Excel Programming 3 November 30th 06 11:34 AM
Change Hyperlink Destination Folder Ron Excel Discussion (Misc queries) 2 July 18th 05 12:55 PM
Get Folder Path RNM[_2_] Excel Programming 1 August 8th 04 03:19 AM


All times are GMT +1. The time now is 12:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"