Goedemorgen,
Ik vraag me af hoe ik automatisch copy's (Back-up's) kan verwijderen die ouder zijn dan zoveel minuten of dagen.
Hieronder heb ik de code die ik gebruik, om een back-up te maken van een Excel bestand, en die op te slaan als iemand hem sluit.
Met Vriendelijke Groet,
Pinguin1
code:
Private Sub Workbook_Open()
ThisWorkbook.SaveCopyAs "C:" & "Backup_" & ThisWorkbook.Name
End Sub
Function FileExists(ByVal FileToTest As String) As Boolean
FileExists = (Dir(FileToTest) <> "")
End Function
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub
Ik vraag me af hoe ik automatisch copy's (Back-up's) kan verwijderen die ouder zijn dan zoveel minuten of dagen.
Hieronder heb ik de code die ik gebruik, om een back-up te maken van een Excel bestand, en die op te slaan als iemand hem sluit.
Met Vriendelijke Groet,
Pinguin1
code:
Private Sub Workbook_Open()
ThisWorkbook.SaveCopyAs "C:" & "Backup_" & ThisWorkbook.Name
End Sub
Function FileExists(ByVal FileToTest As String) As Boolean
FileExists = (Dir(FileToTest) <> "")
End Function
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
ActiveWorkbook.Save
Application.DisplayAlerts = True
End Sub