Nothing to do with .NET.
I meant I suspect the problem could arise when you try to close the Excel
application without first closing explicitely the workbook file.
I would try to close the workbook using the Excel object model before
quitting using the Excel object.
At least you shouldn't have any more the "file is open" error. You'll have
still to check if Excel is still in memory or not...
For now I believe that Excel doesn't "closes" properly if you don't close
yourself the workbook you are working on (remember in interactive mode
you'll have a dialog box asking to save or not).
Patrice
--
"Richie" <an*******@discussions.com> a écrit dans le message de
news:O$**************@TK2MSFTNGP12.phx.gbl...
Hi Patrice,
Thanks for your time.
I am really new to .net, can you tell me explicitly how to do it through
code ?
Thanks again !
"Patrice" <no****@nowhere.com> wrote in message
news:ul**************@TK2MSFTNGP12.phx.gbl... What if you try to close explicitely the file ?
Patrice
--
"Richie" <an*******@discussions.com> a écrit dans le message de
news:uD**************@TK2MSFTNGP14.phx.gbl... I want to close excel application from C#, this is the piece of code I
am trying
"System.Runtime.InteropServices.Marshal.ReleaseCom Object(excelApp);"
GC.Collect();
It ain't working ! Any ideas please !!
Also tried excelApp.Quit();
This is fine, but on viewing "Task List" the application tab shows
"Excel.exe" running. And if I run the program again the message
"Administrator is using the file, file will open in readonly mode" shows.
Any ideas ?