before close msgbox startet 2 mal
06.10.2005 10:17:26
roland_k
habe folgenden code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
If Sheets("sp-ti").CommandButton1.Visible = True Then
UserForm4.Show
Cancel = True
Exit Sub
End If
If Cells(5, 10) = "" Then
frage = MsgBox("willst du schliessen?", vbYesNo)
If frage = vbYes Then
If Workbooks.Count = 1 Then
Application.Quit
Else
Cancel = False
Application.DisplayAlerts = False
ThisWorkbook.Close
Exit Sub
End If
End If
End If
End Sub
funktioniert eigentlich ((( aber warum kummt die msgbox 2 mal hintereinander ?
danke im voraus wenn jemand weiss warum das so ist ?
und ev gleich loesung anbieten kann
gruss roland_k