Close Excel Completely Using VBA

C

Celtic_Avenger

Hi Peeps

Another one for you experts out there.


I have a code that when a button within a userform is pressed, th
active workbook saves then closes.

However is there a way to make it Save and then close the whole Exce
Application, and not leave the empty Excel program running.

I would like to be able to insert this action into the Button Contro
VBA.

I can understand that this would not be a good idea if there were othe
workbooks open in the program, but I can assure you this would not b
the case as I have stoped this from happening by activating the Ignor
other applications option whilst this spreadsheet is open.


Can any one help?

Thanks in advance

Celtic_Avenger
:confused: :confused: :confused: :confused: :confused
 
E

E Oveson

you could probably just save the workbook, and then make a call to
Application.Quit
Since the workbook has already been saved, it won't prompt you before
closing both the workbook and Excel instance:

activeworkbook.save
application.quit


-Erik
 

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

Top