Yvaine
07-05-2008, 06:20 AM
I have a coding in microsoft access to open an excel file. After i close the application, the EXCEL.EXE still appear in the task manager under process. How could i do it? i attache with my coding below:-
Dim App As Excel.Application
Dim WkBk As Excel.Workbook
Set App = CreateObject("Excel.Application")
strCollateral = Trim(dhFileDialog(strInitDir:=C_INAppPath, strFilter:=" All Files(*.*)", strFileName:=" ", strDialogTitle:="Please choose the file"))
On Error GoTo HandleErrors
Set WkBk = Excel.Application.Workbooks.Open(FileName:=strCollateral)
WkBk.Close (False)
App.Quit
Set App = Nothing
'If Not (ExcelApp Is Nothing) Then ExcelApp.Quit
HandleErrors:
Dim intResponse As Integer
Select Case Err.Number
Case 53, 76
intResponse = MsgBox("File or path not found")
Case 71
intResponse = MsgBox("Disk not ready. Retry?")
Case Else
intResponse = MsgBox(Err.Number & " " & Err.Description)
End Select
Dim App As Excel.Application
Dim WkBk As Excel.Workbook
Set App = CreateObject("Excel.Application")
strCollateral = Trim(dhFileDialog(strInitDir:=C_INAppPath, strFilter:=" All Files(*.*)", strFileName:=" ", strDialogTitle:="Please choose the file"))
On Error GoTo HandleErrors
Set WkBk = Excel.Application.Workbooks.Open(FileName:=strCollateral)
WkBk.Close (False)
App.Quit
Set App = Nothing
'If Not (ExcelApp Is Nothing) Then ExcelApp.Quit
HandleErrors:
Dim intResponse As Integer
Select Case Err.Number
Case 53, 76
intResponse = MsgBox("File or path not found")
Case 71
intResponse = MsgBox("Disk not ready. Retry?")
Case Else
intResponse = MsgBox(Err.Number & " " & Err.Description)
End Select