close excel

  • Thread starter Thread starter Sunil
  • Start date Start date
S

Sunil

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.
 
Hi
not tested but try

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top