ist es möglich, dass ich in Excel alle 10 min oder länger gefragt werde, ob ich die Änderungen speichern möchte.
Danke
Option Explicit
Const Prüfabstand = "00:10:00" 'Intervall
Const Prozedur = "SpeicherAbfrage"
Dim datA As Date
Sub StoppeÜberwachung()
On Error Resume Next
Application.OnTime datA, Procedure:=Prozedur, Schedule:=False
End Sub
Sub StarteÜberwachung()
StoppeÜberwachung
datA = Now + TimeValue(Prüfabstand)
Application.OnTime datA, Prozedur
End Sub
Sub SpeicherAbfrage()
If ThisWorkbook.Saved = False Then
If MsgBox("Änderungen speichern?", vbYesNo + vbDefaultButton1, ThisWorkbook.Name) = vbYes _
Then
ThisWorkbook.Save
End If
End If
datA = Now + TimeValue(Prüfabstand)
Application.OnTime datA, Prozedur
End Sub
Und in "DieseArbeitsmappe":
Private Sub Workbook_BeforeClose(Cancel As Boolean)
StoppeÜberwachung
End Sub
Private Sub Workbook_Open()
StarteÜberwachung
End Sub
Gruß Matthias
For Each Workbook In Workbooks
If Workbook.Saved = False Then
If MsgBox("Änderungen speichern?", vbYesNo + vbDefaultButton1, Workbook.Name) = vbYes _
Then Workbook.Save
End If
Next Workbook