Code to Quit App Doesn't Work

S

Sheldon

Hello -

I have a workbook that automatically imports tables from a database via code
and is set with the Windows scheduler.

When it's done importing, I want it to close the workbook and quit the
application. At the end of the import code, I placed the following:

ActiveWorkbook.Close
Application.Quit

It doesn't close and the application doesn't quit. How can I get it to do
that?
 
D

Don Guillett

This may be of help

Sub SaveAllAndQuit()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each wb In Application.Workbooks
wb.Save
Next wb
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

Top