How to move an Excel file to another folder

  • Thread starter Thread starter Akilah
  • Start date Start date
A

Akilah

Hi, I have a function that reads in an excel file and does a process in the
Access database. I want to know is there a way to move that file to another
folder when the process is done. Thanks in advance.
 
Hi, I have a function that reads in an excel file and does a process in the
Access database. I want to know is there a way to move that file to another
folder when the process is done. Thanks in advance.

You could use the Name property to either change the file name or move
it.

Sub RenameDb()
' Rename and/or move a database or a spreadsheet
Dim OldName As String
Dim NewName As String
OldName = "C:\CurrentPath\SpreadsheetName.xls"
NewName = "C:\NewPath\SpreadsheetName.xls"
Name OldName As NewName

End Sub
 
Thanks, I will try that.

fredg said:
You could use the Name property to either change the file name or move
it.

Sub RenameDb()
' Rename and/or move a database or a spreadsheet
Dim OldName As String
Dim NewName As String
OldName = "C:\CurrentPath\SpreadsheetName.xls"
NewName = "C:\NewPath\SpreadsheetName.xls"
Name OldName As NewName

End Sub
 
Back
Top