Access任务退出后,在任务pipe理器中的stil显示直到完全退出

我退出后,在任务pipe理器进程中显示的问题。 我在任务pipe理器中search了很多不同的答案还有过程显示。 我在其他函数中有其他函数,打开和closuresexcel就好了,并从进程中删除,但是我正在运行的当前事件只是将任务pipe理器中的进程退出,直到完全退出访问。 请帮忙!!

Private Sub status_ID_AfterUpdate() On Error GoTo Problems Dim filename As String Dim NewStatus As Long filename = "M:\Shared Documents\Job Cost Analysis\Hospital Active B2B Cases.xlsx" Dim cell As Range Dim xlApp As Excel.Application Dim xlWB As Excel.Workbook Dim ws As Worksheet Set xlApp = New Excel.Application With xlApp .Visible = True Set xlWB = .Workbooks.Open(filename, , False) Set ws = .Worksheets("Active B2B cases") ws.Columns("B:B").Select Set cell = Selection.Find(What:=Me.client_ID.Value, After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False) If cell Is Nothing Then 'do nothing Else 'Update active B2B sheet If Me.status_ID.column(0) = "FINAL PROCESSING" Then ws.Range("E" & (xlApp.cell.Row)).Value = "Final Processing" MsgBox "The client's status has been updated on the Active B2B sheet" ElseIf Me.status_ID.column(0) = "DATA ENTRY" Then ws.Range("E" & (xlApp.cell.Row)).Value = "Data Entry" MsgBox "The client's status has been updated on the Active B2B sheet" ElseIf Me.status_ID.column(0) = "COMPLIANCE REVIEW" Then ws.Range("E" & (xlApp.cell.Row)).Value = "Available To Audit" MsgBox "The client's status has been updated on the Active B2B sheet" ElseIf Me.status_ID.column(0) = "SENIOR COMPLIANCE REVIEW" Then ws.Range("E" & (xlApp.cell.Row)).Value = "2nd Level Review" MsgBox "The client's status has been updated on the Active B2B sheet" ElseIf Me.status_ID.column(0) = "WAITING FOR DOCUMENTATION" Then ws.Range("E" & (xlApp.cell.Row)).Value = "Pending - Doc" MsgBox "The client's status has been updated on the Active B2B sheet" ElseIf Me.status_ID.column(0) = "INVOICED" Then xlApp.cell.EntireRow.Delete MsgBox "The client has been removed from the Active B2B sheet" End If End If End With xlApp.DisplayAlerts = False xlWB.SaveAs (filename) xlWB.Close xlApp.Quit Set cell = Nothing DoEvents Set ws = Nothing DoEvents Set xlWB = Nothing DoEvents Set xlApp = Nothing DoEvents Exit Sub Problems: Err.Clear Resume Next End Sub 

至less在更好的解决scheme出现之前,您可以将其添加到代码的末尾(在将variables设置为Nothing之后)。 注意:这将终止您的机器上的Excel的所有实例。

 Call Shell("taskkill.exe /f /im excel.exe", vbNormalFocus)