View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default Excel process still shows in TaskManager

Move the QuitApplication sub to a standard module and call it from the same sub that loaded the form....

MainForm.Show
Call QuitApplication
--
Jim Cone
Portland, Oregon USA

..
..

"noname"
wrote in message
...
Hi,
I have an Excel MultiPage Form which loads on Workbook_Open event. It
has an Exit button which Unloads the Form & runs the following
Procedure to Close the Workbook and Quit Excel.

Private Sub cmd_Exit_Click()
Unload MainForm
Call QuitApplication
End Sub

Public Sub QuitApplication()
With ThisWorkbook
' Dim ans As Integer
' ans = MsgBox("Do you want to SAVE changes?", vbInformation +
vbYesNo, "Save Workbook")
' If ans = vbYes Then
.Close savechanges:=True
' Else
' .Close savechanges:=False
' End If
End With

Application.Visible = True
For Each obj In Excel.Application
Set obj = Nothing
Next obj
Application.Quit
End Sub


Why is Excel not quitting cleanly? I already checked if there are any
loaded Addins, which in my case there is only the default Funcres.xla
& ATPVBAEN.xla seen in VBE Editor.
I have tried to close all objects in code as well as in the form.
Anyone has any answers?