ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   close work book via macro (https://www.excelbanter.com/excel-programming/287145-close-work-book-via-macro.html)

Sunil Patel

close work book via macro
 
How do you suppress warnings when closing workbook
via macro i.e. do you want to save changes yes or no

thanks in anticipation



Trevor Shuttleworth

close work book via macro
 
Application.DisplayAlerts = False
' your code
Application.DisplayAlerts = True

Regards

Trevor


"Sunil Patel" wrote in message
...
How do you suppress warnings when closing workbook
via macro i.e. do you want to save changes yes or no

thanks in anticipation





Ron de Bruin

close work book via macro
 
Hi Sunil

ActiveWorkbook.Close SaveChanges:=False

or

ActiveWorkbook.Close SaveChanges:=true


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Sunil Patel" wrote in message ...
How do you suppress warnings when closing workbook
via macro i.e. do you want to save changes yes or no

thanks in anticipation





mudraker[_74_]

close work book via macro
 
Workbooks("Name").Close SaveChanges:=True
or
Workbooks("Name").Close SaveChanges:=False


or

Application.DisplayAlerts = False
Workbooks("Name").Close
Application.DisplayAlerts = Tru

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 04:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com