/**Do Garbage Collection as suggested as best practice at:
* http://msdn2.microsoft.com/en-us/library/aa679807(office.11).aspx
*/
excelWorkBooks = null;
mainbook = null;
sheet = null;
someRange = null;
/**Quit the application.*/
excelApplication.Quit();
excelApplication = null;
/**Collect Garbage (Twice).*/
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GC.WaitForPendingFinalizers();
and the following, passing the COM objects when done
private void releaseCOMObject(object COMObject){
try {
if(COMObject != null)
while(System.Runtime.InteropServices.Marshal.ReleaseComObject(COMObject)>0);
}
finally {
COMObject = null;
}
}
These do not work.
What else can I try