I want to close a Excel 2010 file with VBA.. but when the code runs, it shows a prompt confirmation.... i dont want to see this prompt..
didnt work:
Application.DisplayAlerts = False
ActiveWorkbook.Close SaveChanges:=False
is there a way to do this?
Press Windows logo key and the R key to open the Run window. 2.In the Run box, type command: excel /safe and click OK. 3. When Excel is in safe mode, make some changes in the workbook, check if you will get the save prompt when closing the workbook.
Steps to Close a Workbook Specify the workbook that you want to close. Use the close method with that workbook. In the code method, specify if you want to save the file or not. In the end, mention the location path where you want to save the file before closing.
If you're not wanting to save changes set savechanges to false
Sub CloseBook2()
ActiveWorkbook.Close savechanges:=False
End Sub
for more examples, http://support.microsoft.com/kb/213428 and i believe in the past I've just used
ActiveWorkbook.Close False
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With