ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   close excel (https://www.excelbanter.com/excel-programming/314590-close-excel.html)

SUNIL

close excel
 
is it possible for excel to close when then last workwook is closed. I would
like to do this with a macro in sub autoclose.



Frank Kabel

close excel
 
Hi
not tested but try

sub workbook_beforeclose()
if workbooks.count=1 then
application.quit
end if
end sub


"Sunil" wrote:

is it possible for excel to close when then last workwook is closed. I would
like to do this with a macro in sub autoclose.





All times are GMT +1. The time now is 01:44 AM.

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