Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Result shows correct answer but cell shows 0 Lise Excel Discussion (Misc queries) 1 March 2nd 10 01:23 PM
macro for closing all Excel processes visible in TaskManager [email protected] Excel Programming 1 June 12th 08 10:57 AM
Schedule taskmanager via code? Steph[_3_] Excel Programming 1 March 25th 05 06:10 PM
How to count process running time ( process not finished) miao jie Excel Programming 0 January 13th 05 09:23 AM
How to count process running time ( process not finished) miao jie Excel Programming 2 January 12th 05 06:01 AM


All times are GMT +1. The time now is 02:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"