fredmartinmaine
IS-IT--Management
In a vbscript, I open an Excel file to read a few items from it, then close it. I make no changes. However, even though I quit Excel, the process stays in Task Manager, until my script exits.
No matter how long I sit at "test pause" the Excel process stays in Task Manager. When I move on and the script quits, the Excel process dies. Why is that? I have similar issues with Outlook, but it goes grey in Task Manager and never dies. I'll save that for a later discussion.
Code:
Set objExcel = CreateObject("Excel.Application")
objExcel.Application.Visible = False
Set ExcelFile = objExcel.Workbooks.Open(PathAndFileName)
Set WkSheet = ExcelFile.Worksheets(1) ' assume first tab
'read data from a few cells, like:
Content = WkSheet.Cells(2,3)
objExcel.DisplayAlerts = False
ExcelFile.Close FALSE
objExcel.Application.Quit
Set objExcel = Nothing
MsgBox("test pause")
wscript.quit
No matter how long I sit at "test pause" the Excel process stays in Task Manager. When I move on and the script quits, the Excel process dies. Why is that? I have similar issues with Outlook, but it goes grey in Task Manager and never dies. I'll save that for a later discussion.