We help IT Professionals succeed at work.

How to take backup every day using Excel files?

675 Views
Last Modified: 2013-12-01
We have work in Excel files. We need to modify same file every day. How to take backup this file every day? If we take backup in the CD same file, we want to take every day. Every day modify contents should be backup under one file. How to do this?


<<Punctuation and grammar edits made to improve clarity--7/12/08 by byundt, Microsoft Excel Page Editor>>
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2008
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
You could use a batch file.  You can create a batch file with Notepad, as long as you save it with a ".BAT" extension.  The script I am about to give you will append the date to the filename with the copy, so you get a new dated copy every day.  A "BAT" file can be doubleclicked to run immediately, or scheduled to run just like a normal program.

Once you have the batch file, you can schedule it as a task in your Windows Task Scheduler.  Don't forget to close the spreadsheet each night or the backup won't run.  (If you must have the spreadsheet open, then you probably need a different solution).

Note that the three "FOR" commands are tweaks so that you can capture the current date into three variables, %yyyy%, %mm%, and %dd% so they can be used as part the backup filename.  Of course you will want to tweak the copy command so it references the correct folders of your choice.

So this would make a copy of YourExcelFile.xls as Your-Excel-Backup-2008-07-15.xls.  If run tomorrow, it would make a copy as Your-Excel-Backup-2008-07-16.xls.  If scheduled to run daily, you'll automatically have a separate copy of your spreadsheet, one per day, of how it was that day.  You might create a folder for these backups - although my script dumps them in C:\ this is probably not where you really want them.
FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
FOR /F "TOKENS=1,3 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET dd=%%B
FOR /F "TOKENS=1,4 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET yyyy=%%B
 
copy "C:\Whatever\Whatever\YourExcelFile.xls" "C:\Your-Excel-Backup-%yyyy%-%mm%-%dd%.xls"

Open in new window

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.