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
 

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

Back
Top