naddyz said:what about replies from people who press save whilst writing documents?
Scoobie said:..or replies from people who have set their computer up so it automatically makes a backup every 5 minuted?
silvia said:
russ said:silvia said:
Robder said:
x-amount said:Application.StatusBar = "Running Auto Backup, please wait..."
Application.ScreenUpdating = False
Dim W As Workbook
Dim NeedRun As Boolean
Dim DelayBetweenSaves, MyDir As String
MyDir = "H:\My Documents\Excel Backup\"'Location of Backup Directory
DelayBetweenSaves = 15
NeedRun = False
For Each W In Workbooks
If Not W.Saved Then
NeedRun = True
End If
Next
If NeedRun Then
Dim vaFileName As Variant
For Each W In Workbooks
If W.Saved = False Then
n = 0
Do
n = n + 1
With Application.FileSearch
.NewSearch
.LookIn = MyDir
.SearchSubFolders = False
.FileType = msoFileTypeExcelWorkbooks
.Filename = Left(W.Name, Len(W.Name) - 4) & " (" & n & ").xls"
If .Execute = 0 Then
latest = True
W.SaveCopyAs ("H:\My Documents\Excel Backup\" & Left(W.Name, Len(W.Name) - 4) & " (" & n & ").xls")
End If
End With
Loop Until latest
'W.Saved = True
'If W.Name = "PERSONAL.XLS" Then W.Save
End If
Next
Else
'If MsgBox(Now & "Run AutoBackUp later?", vbYesNo, "Avinit") = vbYes Then
End If
Application.OnTime Now + TimeValue("00:" & DelayBetweenSaves & ":00"), "MyAutoBackup"
Application.ScreenUpdating = False
Application.StatusBar = False
End Sub
...Is your friend
x-amount said:Application.StatusBar = "Running Auto Backup, please wait..."
Application.ScreenUpdating = False
Dim W As Workbook
Dim NeedRun As Boolean
Dim DelayBetweenSaves, MyDir As String
MyDir = "H:\My Documents\Excel Backup\"'Location of Backup Directory
DelayBetweenSaves = 15
NeedRun = False
For Each W In Workbooks
If Not W.Saved Then
NeedRun = True
End If
Next
If NeedRun Then
Dim vaFileName As Variant
For Each W In Workbooks
If W.Saved = False Then
n = 0
Do
n = n + 1
With Application.FileSearch
.NewSearch
.LookIn = MyDir
.SearchSubFolders = False
.FileType = msoFileTypeExcelWorkbooks
.Filename = Left(W.Name, Len(W.Name) - 4) & " (" & n & ").xls"
If .Execute = 0 Then
latest = True
W.SaveCopyAs ("H:\My Documents\Excel Backup\" & Left(W.Name, Len(W.Name) - 4) & " (" & n & ").xls")
End If
End With
Loop Until latest
'W.Saved = True
'If W.Name = "PERSONAL.XLS" Then W.Save
End If
Next
Else
'If MsgBox(Now & "Run AutoBackUp later?", vbYesNo, "Avinit") = vbYes Then
End If
Application.OnTime Now + TimeValue("00:" & DelayBetweenSaves & ":00"), "MyAutoBackup"
Application.ScreenUpdating = False
Application.StatusBar = False
End Sub
...Is your friend