Problem beim Schliessen von Datei
30.04.2019 10:25:14
Datei
ich möchte aus einer UF die Datei speichern ohne Rückfrage,
prüfen ob weitere Exceldatei geöffnet und falls nein
Beenden von Excel.
Ich verwende bisher in UF Commandbutton folgende Codes:
1. Code: funktioniert nicht
If Workbooks.Count = 1 Then
Application.DisplayAlerts = False
ThisWorkbook.Saved = False
Application.DisplayAlerts = False
Application.Quit
Else
Application.DisplayAlerts = False
ThisWorkbook.Saved = False
Application.DisplayAlerts = False
ThisWorkbook.Close
End If
~f~
2. Code funktioniert nicht
~f~
If Application.Workbooks.Count > 1 Then
Calculate
ActiveWorkbook.Save
ActiveWorkbook.Close
Exit Sub
ElseIf Application.Workbooks.Count = 1 Then
Calculate
ActiveWorkbook.Save
ActiveWorkbook.Close
Application.Quit
End If
Könnt ihr mir bitte helfen.
Gruss
Peter