M
m.ahrens
Hi All
I have problems Closing excel...
Excel 2003 / Visual Studio 2003 / C#
The Code I use:
oExcel.WorkbookBeforeSave -= EventDel_BeforeBookSave;
oExcel.WorkbookDeactivate -= EventDel_Deactivate;
PIDHandler.NAR(wSheet);
wBook.Close(false, Type.Missing, Type.Missing);
PIDHandler.NAR(wBook);
PIDHandler.NAR(wBooks);
oExcel.Quit();
PIDHandler.NAR(oExcel);
GC.Collect();
GC.WaitForPendingFinalizers();
static public void NAR(object o)
{
try
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(o);
}
catch
{
}
finally
{
o = null;
}
}
After Compleating the code above, Excel produces a total crash: "Microsoft
Office Excel has encountered a problem and needs to close. We are sorry for
the inconvenience." You know, this error, where you can send a "Error Report"
to microsoft. What might i be doing wrong?
thanks for your help
m.ahrens
I have problems Closing excel...
Excel 2003 / Visual Studio 2003 / C#
The Code I use:
oExcel.WorkbookBeforeSave -= EventDel_BeforeBookSave;
oExcel.WorkbookDeactivate -= EventDel_Deactivate;
PIDHandler.NAR(wSheet);
wBook.Close(false, Type.Missing, Type.Missing);
PIDHandler.NAR(wBook);
PIDHandler.NAR(wBooks);
oExcel.Quit();
PIDHandler.NAR(oExcel);
GC.Collect();
GC.WaitForPendingFinalizers();
static public void NAR(object o)
{
try
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(o);
}
catch
{
}
finally
{
o = null;
}
}
After Compleating the code above, Excel produces a total crash: "Microsoft
Office Excel has encountered a problem and needs to close. We are sorry for
the inconvenience." You know, this error, where you can send a "Error Report"
to microsoft. What might i be doing wrong?
thanks for your help
m.ahrens