oWB = Nothing oSheet = Nothing oXL.Quit() While (System.Runtime.InteropServices.Marshal.ReleaseComObject(oXL) <> 0) ' Repeat until no more COM references End While oXL = Nothing ' Invoke garbage collector before termination GC.Collect() GC.WaitForPendingFinalizers()Thanks