Move folder in XP

P

Peter

Hi,

The following macro takes files that are in one directory ("C:\Fishbowl\Req_Serv\one"), and puts them in a newly created directory ("C:\Fishbowl\Solved_Service_Cases\one". This works in Excel 2000 running on 98, but does not work in Excel 2000 running on XP.

In 98, this creates a new subdir named "one" under "Solved_Service_Cases" and MOVES everything from the first directory into it.

(Before running this macro, there is a dir called "one" in the "oldname" directory but not in the NewName directory.)
I have heard that XP will not create a new diredtory this way.

Can anyone tell me how I can make a new subdirectory, and MOVE (not just save as) the contents of another directory into it using XP?



Thank you very much

Sub xp98()

Dim OldName As String
Dim NewName As String
Dim myfolder As String

With ThisWorkbook
myfolder = ("one")


OldName = "C:\Fishbowl\Req_Serv\" & myfolder
NewName = "C:\Fishbowl\Solved_Service_Cases\" & myfolder
Name OldName As NewName

End With

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top