Access VBA - cannot close instance of Excel object
Posted on 2013-06-14
I have an Access 2007 app that opens an Excel workbook, does some processing, and closes the workbook. However, I cannot get rid of the Excel object.
Dim Xl As Object
Dim CurrXLS As Object
Set Xl = CreateObject("Excel.Application")
Set CurrXLS = Xl.Workbooks.Open(strPath)
...Do some processing
Xl.Quit (or Xl.Application.Quit - neither works)
Set Xl = Nothing
However, despite the Close and Quit commands the Excel object remains active and does not disappear from Task Manager until the code is stopped.
Does anybody have any suggestions?