tyler --
I can think of a couple of things you might want to look at. For example,
there are several events that you can hook, if you are creating your Excel
Application in c#. For example:
Excel.ApplicationClass myClass = new
Microsoft.Office.Interop.Excel.ApplicationClass();
myBook2 = myClass.Workbooks.Open(sExcelFile,x,x,x,x,x,x,x,x, x,x,x,x,x,x);
myClass.WorkbookBeforeClose += ...
The WordbookBeforeClose event will fire everytime a user clicks the close
button. You can add code to verify that there is still at least 1 workbook
open. Or you could prevent them from closing the workbook all together.
If you are more concerned about the Excel Application as a whole, you can
always check to see if (myClass == null), or, you can look at the
System.Diagnostics.Processes.GetProcessesByName method, and see if excel is
still running.
good luck, jason
"tyler" <sn*****@hotmail.com> wrote in message
news:69**************************@posting.google.c om...
I am writing a C# program which creates an Excel Application and
inside of this applicaion, multiple workbooks. Here is my problem: I
need to be able to tell/determine if the Excel Application has been
closed by the user. If the excel application is closed, then I need
to recreate an Excel Application to continue adding workbooks to.
Does anyone have an idea or example code on how to determine if an
Excel Application has been closed or if it is still running?
Thanks in advance for any help!