I actually know exactly what you are talking about.
On my last application I was automatizing the exportation of information to excel files and I would close the objects using this code block:
vb Code:
Public Sub releaseObject(ByVal obj As Object) Try System.Runtime.InteropServices.Marshal.ReleaseComObject(obj) obj = Nothing Catch ex As Exception obj = Nothing Finally GC.Collect() End Try
and then I would call them using:
vb Code:
releaseObject(xlApp) releaseObject(xlWorkBook) releaseObject(xlWorkSheet201)




Reply With Quote
