S
siedem
Hi
I have very strange problem with excel process. (C#, Win 2k, Office 2002)
I can open application process:
m_objExcel = new Application();
Later i'm working with this, write some data from sql2000 to cells and try
to close excel. Everything seems to be ok but process doesn't end. What's
interesting if i have for exeample small quantity of data (single table)
process end. But if i have more tables - it doesn't. Are there any timeouts
or any tricks to do it?
m_objBook.SaveAs(filePath, m_objOpt, m_objOpt, m_objOpt, m_objOpt, m_objOpt,
XlSaveAsAccessMode.xlNoChange, m_objOpt, m_objOpt, m_objOpt, m_objOpt,
m_objOpt);
m_objBook.Close(false, m_objOpt, m_objOpt);
m_objExcel.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(m_objSheets);
System.Runtime.InteropServices.Marshal.ReleaseComObject(m_objBook);
System.Runtime.InteropServices.Marshal.ReleaseComObject(m_objBooks);
System.Runtime.InteropServices.Marshal.ReleaseComObject(m_objExcel);
//Clean-up
m_objFont=null;
m_objRange = null;
m_objSheet = null;
m_objSheets = null;
m_objBooks = null;
m_objBook = null;
m_objExcel = null;
GC.Collect();
GC.WaitForPendingFinalizers();
thanks in advance
P.
I have very strange problem with excel process. (C#, Win 2k, Office 2002)
I can open application process:
m_objExcel = new Application();
Later i'm working with this, write some data from sql2000 to cells and try
to close excel. Everything seems to be ok but process doesn't end. What's
interesting if i have for exeample small quantity of data (single table)
process end. But if i have more tables - it doesn't. Are there any timeouts
or any tricks to do it?
m_objBook.SaveAs(filePath, m_objOpt, m_objOpt, m_objOpt, m_objOpt, m_objOpt,
XlSaveAsAccessMode.xlNoChange, m_objOpt, m_objOpt, m_objOpt, m_objOpt,
m_objOpt);
m_objBook.Close(false, m_objOpt, m_objOpt);
m_objExcel.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(m_objSheets);
System.Runtime.InteropServices.Marshal.ReleaseComObject(m_objBook);
System.Runtime.InteropServices.Marshal.ReleaseComObject(m_objBooks);
System.Runtime.InteropServices.Marshal.ReleaseComObject(m_objExcel);
//Clean-up
m_objFont=null;
m_objRange = null;
m_objSheet = null;
m_objSheets = null;
m_objBooks = null;
m_objBook = null;
m_objExcel = null;
GC.Collect();
GC.WaitForPendingFinalizers();
thanks in advance
P.