Replace this code
If Not IsNothing(xlsWorkbook) Then
xlsWorkbook.Close()
xlsLookup.Quit()
releaseObject(xlsLookup)
releaseObject(xlsWorkbook)
releaseObject(xlsSheet)
End If
with this
releaseComObject(xlsSheet)
xlsWorkbook.Close(False)
releaseComObject(xlsWorkbook)
xlsLookup.Quit()
releaseComObject(xlsLookup)
GC.Collect()
GC.WaitForPendingFinalizers()
Private Sub releaseComObject(ByVal o As Object)
Try
System.Runtime.InteropServices.Marshal.ReleaseComObject(o)
Catch
Finally
o = Nothing
End Try
End Sub
1) Note the sequence of releasing object references.
2) Globals are never recommended, especially with COM references and debugging. You should open Excel, use it and release it. The performance hit is minimal compared to managing COM references.
3) Starting a new process thread will cause all sorts of trouble because it will have no concept of your user interface thread and can only communicate via invokes. Multithreading is a deep subject and rarely offers much of a performance gain in typical .net applications.