AutoSave a WB copy everynight at midnight

  • Thread starter Thread starter sp00nix
  • Start date Start date
S

sp00nix

We have a file that is updated constantly and would like to star
tracking the changes. I could make a macro that would easily save
copy everytime the file is edited by a user, but that would create
lot of files! Is there any way i could have the workbook saved to
particular location every day at midnight?

It would be saved as "myWB" & Date & ".xls" to keep the files uniquel
named
 
Hi
I would not use Excel/VBA for this as this would require a running
Excel application. Try searching for a scheduling program on operating
system level (there're a lot of shareware schedulers available)
 
Windows Task Scheduler??

Build a *.bat or *.vbs file to save the workbook. Task Scheduler would run
that file at midnight.

Gord Dibben Excel MVP
 
And that's exactly what I did.. Here's the code for anyone who woul
like to reference this thread in the future:


Code
-------------------

Dim fso
Dim myDate
if len(month(date())) = 2 then
myDate = Replace(FormatDateTime(Date(),2),"/","-")
else
myDate = "0" & Replace(FormatDateTime(Date(),2),"/","-") & " "
end if
set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "myFile.xls", _
"c:\backup\myFile" _
& myDate _
& Replace(FormatDateTime(Time(),4),":",".") & ".xls"
set fso = nothing
'msgbox "Done!"
 

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