[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Owen

11/23/2007 8:28:00 PM

I know that this question is ask a lot of time, but I try everything about
this theme and nothing

I have windows xp sp2 with office 2007, V.S 2003 with .Net 1.1The code was tested inside WebApp ASP.NET C#

I have this code:
Application application = null;
Workbooks workbooks = null;
Workbook workbook = null;
CultureInfo ci = null;

ci = System.Threading.Thread.CurrentThread.CurrentCulture;
System.Threading.Thread.CurrentThread.CurrentCulture = new
CultureInfo("en-US");
//
application = new ApplicationClass();
application.Visible = true;
application.ScreenUpdating = false;
application.DisplayAlerts = false;

workbooks = application.Workbooks;
//[1*]
workbooks.Close();
application.Quit();
NAR(workbook);
NAR(workbooks);
NAR(application);
GC.Collect();
//
System.Threading.Thread.CurrentThread.CurrentCulture = ci;

and work fine, the exel disappear from precess, BUT when add this code
inside [1*] line:

workbook = workbooks.Open(edFile.Text, //Source File Name
0, //UpdateLinks
false, //ReadOnly
5, //Format
"", //Password
"", //WriteResPassword
true, //IgnoreReadOnly
XlPlatform.xlWindows, //Origin
"\t", //Delimiter
true, //Editable
false, //Notify
0, //Converter
false, //AddToMru
null, //Load
null); //CorruptLoad

The file is open fine, BUT finally in app.Quit() the excel not disappear
from process never. I appreciate any help to close this excel from process.

PD: I test too getting the worksheet and free it too and nothing

Best regards,
Owen.