Rejje
12-01-2010, 06:42 AM
Hi! How can I alter this macro so that Excel will not ask for saving YES/NO/CANCEL?
This should be a force close code for the workbook. In case it's the last open workbook; force close application. Any ideas someone?
Sub CloseNoSave()
Dim answer As VbMsgBoxResult
answer = MsgBox("Do you really want to quit without saving?", vbYesNo)
If answer = vbYes Then
If Workbooks.Count = 1 Then
Application.Quit
Else
ThisWorkbook.Close (False)
End If
End If
End Sub
This should be a force close code for the workbook. In case it's the last open workbook; force close application. Any ideas someone?
Sub CloseNoSave()
Dim answer As VbMsgBoxResult
answer = MsgBox("Do you really want to quit without saving?", vbYesNo)
If answer = vbYes Then
If Workbooks.Count = 1 Then
Application.Quit
Else
ThisWorkbook.Close (False)
End If
End If
End Sub