Helpers,
Voor het sluiten van een userform/workbook heb ik onderstaande code:
Echter krijg ik alsnog de 'standaard' melding op Application.Quit of ik het bestand wil opslaan. Terwijl ik dit toch echt lees op MSDN onder Application.Quit
If unsaved workbooks are open when you use this method, Microsoft Excel displays a dialog box asking whether you want to save the changes. You can prevent this by saving all workbooks before using the Quit method or by setting the DisplayAlerts property to False. When this property is False, Microsoft Excel doesn’t display the dialog box when you quit with unsaved workbooks; it quits without saving them.
If you set the Saved property for a workbook to True without saving the workbook to the disk, Microsoft Excel will quit without asking you to save the workbook.
Hoe kan ik deze 'standaard' melding van Excel nou onderdrukken?
Voor het sluiten van een userform/workbook heb ik onderstaande code:
Code:
Private Sub CommandButton5_Click()
Application.DisplayAlerts = False
If MsgBox("Weet u zeker dat u wilt sluiten zonder opslaan?", vbYesNo + vbQuestion, "Sluiten") = vbYes Then
If Sheets("DATA").Visible = True Then Sheets("DATA").Visible = xlVeryHidden
If Workbooks.Count = 1 Then Application.Quit Else: ThisWorkbook.Close False
Else: Exit Sub
End If
Application.DisplayAlerts = True
End Sub
Echter krijg ik alsnog de 'standaard' melding op Application.Quit of ik het bestand wil opslaan. Terwijl ik dit toch echt lees op MSDN onder Application.Quit
If unsaved workbooks are open when you use this method, Microsoft Excel displays a dialog box asking whether you want to save the changes. You can prevent this by saving all workbooks before using the Quit method or by setting the DisplayAlerts property to False. When this property is False, Microsoft Excel doesn’t display the dialog box when you quit with unsaved workbooks; it quits without saving them.
If you set the Saved property for a workbook to True without saving the workbook to the disk, Microsoft Excel will quit without asking you to save the workbook.
Hoe kan ik deze 'standaard' melding van Excel nou onderdrukken?