sweeneytime
Board Regular
- Joined
- Aug 23, 2010
- Messages
- 183
Hi,
I am getting a "Runtime Error 53 - File not Found" with the below code. I am trying to move xml files from one folder to another. The file exists as my other macro can access the xml files and extract the info. But i can't get the macro to move them! Any help would be much appreciated. Removing the last slash in the folder address hasn't worked either.
Cheers,
Sweeneytime
I am getting a "Runtime Error 53 - File not Found" with the below code. I am trying to move xml files from one folder to another. The file exists as my other macro can access the xml files and extract the info. But i can't get the macro to move them! Any help would be much appreciated. Removing the last slash in the folder address hasn't worked either.
Cheers,
Sweeneytime
HTML:
Public Sub move()
Dim MyFolder As String
Dim NewFolder As String
Dim MyFile As String
MyFolder = "\\orcfinance\DynamicsGP\WebStore\FTP\Data\New\"
NewFolder = "\\orcfinance\DynamicsGP\WebStore\FTP\Data\Archive\"
MyFile = Dir(MyFolder & "\*.xml")
Do While MyFile <> ""
Name MyFolder & "\" & MyFile As NewFolder & "\" & MyFile
MyFile = Dir
Loop
End Sub