Move a folder under XP

P

Peter

Hi

The following macro takes files that are in one directory, and puts them in a newly created directory. This works in Excel 2000 running on 98, but does not work in Excel 2000 running on XP
(I put a On Error goto line before the rename directory lines, and in XP it jumps and does not create the new directory. In 98 it moves the directory

(Before running this macro, there is a dir called "one" in the "oldname" directory.
I have heard that XP will not create a new diredtory this way
Can anyone tell me how to do this in XP

I can make a new directory, and save the file in it, but how do I delete the original folder and file

Thank you very muc

Sub xp98(

Dim OldName As Strin
Dim NewName As Strin
Dim myfolder As Strin

With ThisWorkboo
myfolder = ("one"

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

End Wit

End Su
 
B

Bob Phillips

Peter,

It seems to not work if the folder 'C:\Fishbowl\Solved_Service_Cases\' does
not exist, but does work if if does. In other words, it appears to not
create any parent directories that don't exist, I don't know if this is so
on 98.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Peter said:
Hi,

The following macro takes files that are in one directory, and puts them
in a newly created directory. This works in Excel 2000 running on 98, but
does not work in Excel 2000 running on XP.
(I put a On Error goto line before the rename directory lines, and in XP
it jumps and does not create the new directory. In 98 it moves the
directory)
 

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