Auto Create an Excel Backup File on a Daily Basis

I

igbert

I have an Excel file called "ABC Ltd" that users update on a daily basis.

Does anyone know know to auto create a backup at the end of a day?

If today is October 2, 2009, the back up file name will be "Backup of ABC
Ltd_20091002.xlk"

And at end of next day, auto create another backup called "Backup of ABC
Ltd_20091003.xlk" and so on the days to come.

Thanks

Igbert
 
K

KC

only easy way i can think of is using the windows scheduler, i have given
below two steps to achieve this...

Step 1:
create a file MyBackUp.vbs
Open this file in Notepad and paste and save the below code

'Code Start
'================================
'kc - VBScript for creating backup file
Dim FSO
Dim strSource
Dim strDest

strSource="C:\\KC\\ABC Ltd.xls"
' change the above 'C:\\KC' to your actual file folder location


strDest="C:\\KC\\Backup of ABC Ltd_" _
& year(Now()) & Lpad(month(Now())) & Lpad(day(Now())) &".xls"
'change the above 'C:\\KC' to your required destination location

Set FSO = CreateObject("Scripting.FileSystemObject")

FSO.CopyFile strSource, strDest


Function Lpad (MyValue)
Lpad=MyValue
if Len(MyValue)=1 then
Lpad="0" & MyValue
End If
End Function

'End of code
'==========================


Save the above file; lets say C:\KC\MyBackUp.vbs


Step 2: (to call this file automatically daily @ 5:00 PM)
*Go to Control panel
*Open 'Scheduled Tasks'
*Add Scheduled Tasks
*Next
*Browse
*select the C:\KC\MyBackUp.vbs file
*Daily
*Start Time: 5:00 PM and perform this task 'Every Day'
*provide your computer login username and password
*Finish

-Obviously the system should be running at 5:00PM


All the best!
-kc
*Click YES if this helps
 

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