ich hab mal wieder eine Frage:
Im unten angezeigten Code will ich mir ganz zum Schluss
Zuletzt geändert von wem und wann speichern lassen.
Das passiert auch, jedoch wird nach der ersten Möchtest du Speichern-Abfrage eine weitere Möchtest du deine Änderungen Speichern- Abfrage. Wie muss ich den Code verfassen, damit letztere Abfrage nicht mehr erscheint?
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If bNurClose Then Exit Sub
Dim ans As VbMsgBoxResult, SV As Boolean
ans = MsgBox("Speichern?", vbYesNoCancel, "Achtung")
SV = ans = vbYes
Cancel = ans = vbCancel
If Not (Cancel = True) Then
If SV Then
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
End If
ThisWorkbook.Saved = True
If Application.Workbooks.Count = 1 Then
Application.Quit
Else
bNurClose = True
ThisWorkbook.Close False
End If
Range("C78").Value = Date & " " & Time
[c79] = ThisWorkbook.BuiltinDocumentProperties("Last Author")
End If
End Sub