View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Code to Quit App Doesn't Work

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

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Sheldon" wrote in message
...
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?
--
Sheldon