Application won't die!

Yep thought so. It is possible to detect whether an application is closed down manually or programmatically. I really can't stand attention-seeking programs. I think it is poor programming to force priority especially in the window environment.
 
tkpstock said:
I think I've finally figured it out. We use LiveLink here at work. It has an associated addin that wasn't allowing the associated VBA projects to close down properly - there was a similar problem with the Google desktop addins. Once I change the appropriate registry key, everything started working properly!

The registry key in question is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Excel\Addins\LLAppInt.Connect

The value that was the problem:
LoadBehavior (3) <-- load on startup

Once I changed it to
LoadBehavior (9) <-- load on deman

everything started working properly. Yay!!!

Thanks tkpstock. I had the exact problem and we use Livelink. Everything is working properly.
 
Just to follow up:

OpenText has corrected this issue in their latest version of LiveLink, supposedly. We don't have that version yet, so I can't test it to be sure. My company opened a ticket with OpenText, they were aware of the issue and resolved it.

This is the statement from OpenText (Explorer refers to LiveLink Explorer):

The bug details are as follows:

Initially reported in Livelink 9.2/Explorer 4.4.2, replicated in 4.5.0 with Livelink 9.5, Windows XP SP2, Excel 2003

Steps to replicate:

1) In Excel, save a file as test001.xls to c:\temp
2)Create a new workbook in Excel
3) Select Tools..Macro..Macro..
4) Enter a name in Macro name field
5) Select Create button.
6) Place the following between
Sub %name%() and End Sub

Set myExcel = CreateObject "Excel.Application")
myExcel.Workbooks.Open ("c:\temp\test001.xls")
MsgBox "point1000"
myExcel.Workbooks.Close
MsgBox "point1001"
Set myExcel = Nothing

7) Go to Run Menu
8) Select RunSub/UserForm
9) Observe a dialog box with text of "point1000" appears
10) Select OK
11) Close Visual Basic
12) Close Excel
12) Review Processes Tab in Task Manager. Excel.exe remains a running process.

In the case Livelink Explorer Professional Activation for Microsoft Excel is NOT checked, use of the same steps does not lead to a running Excel.exe process.

End users are doing lots of Excel exports (through VB scripts) the issue occurs :
- at the first Excel exports : it runs ok but the excel.exe process is still active – doesn’t stop properly
- at the second Excel export : they can’t run it because the Excel process is busy

You are right that manually kill the process is a workaround …but end users can’t do this every time ….

Apparently this issue is not only with Excel …but with all Office applications .

In Explorer 4.1.2, they never got this issue. They had to migrate in 4.4.2 in order to use new functionalities of this version and the issue appears since then.
 
I'm just posting to see if anyone has a found a solution to this -- I am having exactly the same problem. I open Excel, drop some data in, close the file, do what I think is necessary to close the application, and the instance of Excel hangs around. I am using Access2K on Windows 2KPro ...
 
Are you using Livelink or some other COM add-in?

See the solution (work-around) above - changing the registry key LoadBehavior with the add-in.

HTH
 
let me bring alive this thread:

sigh..the multiple process EXCEL.exe is rearing its ugly head again....and
when its running, my code doesnt work..no exporting done..sigh any help?
while i'm still searching the forumns for a solution...heres my latest code:

Code:
Private Sub cmdExpToExcel_Click()
   
'code behind command button "Export to Excel"
   Dim lngMax As Long
   Dim lngCount As Long
   Dim xlApp As Object
   Dim xlBook As Object
   Dim xlSheet As Object
   Dim strFile As String
   Dim running As Boolean
   
   Set maindb = CurrentDb()
   Set mainqdf = maindb.QueryDefs("qryCOSearch")
   Set mainRst = mainqdf.OpenRecordset(dbOpenDynaset, dbEdit)
   'all code below explains exporting the query results to excel
           'allow user to choose path to save to
           strFile = GetSaveFile_CLT("C:\", "Save this file as",
"strDefName")
           If strFile = "" Then
           'user clicked cancel
           Exit Sub
           End If
               'defining the variables
               On Error Resume Next
               Set xlApp = GetObject("Excel.Application")
               If xlApp Is Nothing Then
               Set xlApp = CreateObject("Excel.Application")
               Err.Clear
               End If
               On Error GoTo Err_Handler
               Set xlBook = xlApp.Workbooks.Add
               Set xlSheet = xlBook.Worksheets.Add
               'formatting cells in excel
                   With xlSheet
                       For Each Cell In xlSheet.Range("A1", "S1")
                       Cell.Font.Size = 10
                       Cell.Font.Name = "Arial"
                       Cell.Font.Bold = True
                       Cell.Interior.Color = rgb(204, 255, 255)
                       Cell.HorizontalAlignment = xlHAlignCenter
                       Cell.WrapText = True
                   Next
                       .Cells(1, 2).HorizontalAlignment = xlHAlignLeft
                       .Columns("A:S").HorizontalAlignment = xlHAlignLeft
                       .Columns("A").ColumnWidth = 10
                       .Columns("B").ColumnWidth = 24
                       .Columns("C:D").ColumnWidth = 12
                       .Columns("E").ColumnWidth = 40
                       .Columns("F").ColumnWidth = 30
                       .Columns("G").ColumnWidth = 8
                       .Columns("H").ColumnWidth = 32
                       .Columns("I:J").ColumnWidth = 24
                       .Rows(1).RowHeight = 16
                   End With
                   'deleting all other worksheets except for "Results"
                    For lngCount = lngMax To 1 Step -1
                    If xlBook.Worksheets(lngCount).Name <> "Results" Then
                    xlBook.Worksheets(lngCount).Delete
                    End If
                    Next lngCount
                   'copying the query results from the recordset to the
excel file
                   With xlSheet
                       .Name = "Results"
                       .UsedRange.ClearContents
                       lngMax = mainRst.Fields.Count
                       For lngCount = lngMax To 1 Step -1
                       .Cells(1, lngCount).Value = mainRst.Fields(lngCount -
1).Name
                   Next lngCount
                       .Range("A2").CopyFromRecordset mainRst
                   End With
                   lngMax = xlBook.Worksheets.Count
                   'deleting all other worksheets except for "Results"
                    For lngCount = lngMax To 1 Step -1
                    If xlBook.Worksheets(lngCount).Name <> "Results" Then
                    xlBook.Worksheets(lngCount).Delete
                    End If
                    Next lngCount

                       xlBook.SaveAs strFile
                       MsgBox "Export Completed,Do you want to open your
file?", vbYesNo
                       If Yes Then
                       xlApp.Visible = True
                       xlApp.UserControl = True
                       xlBook.Visible = True
                       xlBook.UserControl = True
                       End If
                       If No Then
                       'stay in result window, clean up by closing objects
and ending excel process
                       xlApp.Visible = False
                       xlBook.Visible = False
                       xlSheet.Close True
                       xlBook.Close True
                       xlApp.Close True
                       Set xlSheet = Nothing
                       Set xlBook = Nothing
                       Set xlApp = Nothing
                       xlApp.Quit = True
                       End If
Exit_Handler:

   'clean up
  If Not mainRst Is Nothing Then
      mainRst.Close
      Set mainRst = Nothing
  End If

  If Not mainqdf Is Nothing Then
      Set mainqdf = Nothing
  End If

  If Not maindb Is Nothing Then
      Set maindb = Nothing
  End If
      
  Exit Sub
     
Err_Handler:
   On Error Resume Next
   Resume Exit_Handler
   MsgBox Err.Description, vbExclamation, "Error No: " & Err.Number
   Resume
End Sub
if when i click No at the prompt, EXCEL.EXE remains running in task manager. and when i search again..the prompt doesnt popup..which i think should be export failure..

when i click yes, excel doesnt launch.
sigh why is this problem occuring so many times across access developers??
i'm still scanning the forumn and other forumns for a solution while i hope someone here can solve this for me. And i don't think i have LiveLink, i just use the normal IE.
 
Last edited:
There are multiple COM addins that can cause this problem. I think one of the search engine (Google / Yahoo / etc) toolbars also caused this problem. Disable all your COM addins and see if you still have the problem.

Load a COM add-in

On the View menu, point to Toolbars, and then click Customize.

Click the Commands tab.

Under Categories, click Tools.

Under Commands, click COM Add-Ins and drag your selection to the toolbar.

Click COM Add-Ins on the toolbar to see a list of the available add-ins in the COM Add-Ins dialog box.

Unload a COM add-in

Do one of the following:

To unload an add-in from memory but keep its name in the list, clear the check box next to its name in the COM Add-in dialog box, and then click OK.

Note Unloading or removing an add-in doesn't remove the add-in file from your computer.

To remove an add-in from the list and from your disk, click the add-in name, and then click Remove.

HTH!
 

Users who are viewing this thread

Back
Top Bottom