Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel process still shows in TaskManager
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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel process still shows in TaskManager
On Sep 2, 4:45*pm, "Jim Cone" wrote:
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 ... 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? =========================== Hi Jim, "and call it from the same sub that loaded the form...." I did not understand this... The QuitApplication() sub is located in a Standard Module. The Exit Button is on the MainForm. There is no code in Workbook_Close(). The Workbook_Open event shows as : Private Sub Workbook_Open() Application.Visible = False Call DefineNames Load MainForm MainForm.Show End Sub Any ideas? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel process still shows in TaskManager
"and call it from the same sub that loaded the form"
Move the call to QuitApplication From... "Sub cmd_Exit_Click()" To... "Sub Workbook_Open". -- Jim Cone Portland, Oregon USA http://www.mediafire.com/PrimitiveSoftware .. .. "noname" wrote in message ... On Sep 2, 4:45 pm, "Jim Cone" wrote: 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 =========================== Hi Jim, "and call it from the same sub that loaded the form...." I did not understand this... The QuitApplication() sub is located in a Standard Module. The Exit Button is on the MainForm. There is no code in Workbook_Close(). The Workbook_Open event shows as : Private Sub Workbook_Open() Application.Visible = False Call DefineNames Load MainForm MainForm.Show End Sub Any ideas? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel process still shows in TaskManager
On Sep 2, 6:02*pm, "Jim Cone" wrote:
*"and call it from the same sub that loaded the form" Move the call to QuitApplication From... "Sub cmd_Exit_Click()" * To... "Sub Workbook_Open". -- Jim Cone Portland, Oregon *USAhttp://www.mediafire.com/PrimitiveSoftware . . "noname" wrote in ... On Sep 2, 4:45 pm, "Jim Cone" wrote: 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 =========================== Hi Jim, "and call it from the same sub that loaded the form...." I did not understand this... The QuitApplication() *sub is located in a Standard Module. The Exit Button is on the MainForm. There is no code in Workbook_Close(). The Workbook_Open event shows as : Private Sub Workbook_Open() * * Application.Visible = False * * Call DefineNames * * Load MainForm * * MainForm.Show End Sub Any ideas? ==================== Hi Jim, You mean like this: Private Sub Workbook_Open() Application.Visible = False Call DefineNames Load MainForm MainForm.Show Call QuitApplication End Sub |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel process still shows in TaskManager
On Sep 2, 7:40*pm, noname wrote:
On Sep 2, 6:02*pm, "Jim Cone" wrote: *"and call it from the same sub that loaded the form" Move the call to QuitApplication From... "Sub cmd_Exit_Click()" * To... "Sub Workbook_Open". -- Jim Cone Portland, Oregon *USAhttp://www.mediafire.com/PrimitiveSoftware . . "noname" wrote in ... On Sep 2, 4:45 pm, "Jim Cone" wrote: 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 =========================== Hi Jim, "and call it from the same sub that loaded the form...." I did not understand this... The QuitApplication() *sub is located in a Standard Module. The Exit Button is on the MainForm. There is no code in Workbook_Close(). The Workbook_Open event shows as : Private Sub Workbook_Open() * * Application.Visible = False * * Call DefineNames * * Load MainForm * * MainForm.Show End Sub Any ideas? ==================== Hi Jim, You mean like this: Private Sub Workbook_Open() * * Application.Visible = False * * Call DefineNames * * Load MainForm * * MainForm.Show * * Call QuitApplication End Sub ================== Well, i tried that, and its still the same.... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Result shows correct answer but cell shows 0 | Excel Discussion (Misc queries) | |||
macro for closing all Excel processes visible in TaskManager | Excel Programming | |||
Schedule taskmanager via code? | Excel Programming | |||
How to count process running time ( process not finished) | Excel Programming | |||
How to count process running time ( process not finished) | Excel Programming |