Closing file and excel

  • Thread starter Thread starter Jean-Paul De Winter
  • Start date Start date
J

Jean-Paul De Winter

Hi,
I created a pushbutton with following code:

Private Sub CommandButton4_Click()
ActiveWorkbook.Close
End Sub

When I click I am asked if I want to save the workbook....
Tha idea is, when clicking the button, ALWAYS save the wrokbook and close
excel.

What code should I add?

Thanks
 
Hi
try
Private Sub CommandButton4_Click()
activeworkbook.save
application.quit
end sub
 
great... just what I wanted
Thanks
JP
Frank Kabel said:
Hi
try
Private Sub CommandButton4_Click()
activeworkbook.save
application.quit
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