View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 1,560
Default Move File to New Directory

Thanks Tom....
the line chdir Curdir & "\.." did it...
I was just using chdir ".."
Thanks much!


"Tom Ogilvy" wrote:

demo'd from the immediate window:

? curdir
C:\Documents and Settings\Thomas Ogilvy\My Documents
chdir Curdir & "\.."
? curdir
C:\Documents and Settings\Thomas Ogilvy

--
Regards,
Tom Ogilvy


"David" wrote in message
...
Yes...this seems simple enough...but I do not have control of the file
locations. I need to set a variable for the current location, move up one
directory, and copy the files to the location. Not so simple once you
throw
in that variable. Thanks for trying!

"Don Guillett" wrote:


maybe this simple idea will help? Modify to suit
Sub movefile()
OldName = "C:\oldfolder\oldname.xls"
NewName = "C:\newfolder\newname.xls"
Name OldName As NewName
End Sub


--
Don Guillett
SalesAid Software

"David" wrote in message
...
I have a workbook that posts to two other workbooks. As part of the
setup
process, all three files are in the same directory (wherever the user
initially saves them by downloading from our website or saving from
email).
About 140 locations will use these files, and each one can initially
place
them wherever they want, on their local or network drives, so I cannot
fix
the path and force where the files are initially placed. When the main
file
is opened, VBA sets up a subdirectory called 2007 Budget, and creates a
master file. I need to MOVE the other two files into this subdiretory
as
part
of the set up process so they are in the same subfolder. I just need to
go
up
one directory from the 2007 Budget directory and move these files down
to
the
2007 Budget directory. Can anyone help? Thanks!