So I have an access file that I regularly need copied to another directory, replacing the last version. I would like to use an Excel macro to achieve this, and would also like to rename the file in the process.
E.g.
fileName = "X:\Database\oldName.accdb"
copyDestination = "Y:\dbstore\"
newName = "newName.accdb"
Is there an easy way of doing this?
One thing that caused me a massive headache when using this code (might affect others and I wish that somebody had left a comment like this one here for me to read):
My solution will be to run the code (On timer event) from another hidden form that opens with the database.
This method is even easier if you're ok with fewer options:
FileCopy source, destination
Source: Stackoverflow.com