Hi,
I'm developping a windows application which allows user loading and printing
an Excel file. My question is about the code of opening a Excel file: here it
is:
Excel.ApplicationClass _mExcelApp;
Excel.Workbook _mWorkbook;
string _mstrXLSFileFullName = XLSFileFullName;
_mExcelApp.Visible = _mblnExcelVisible;
_mExcelApp.WindowState = Excel.XlWindowState.xlMinimized;
_mWorkbook = _mExcelApp.Workbooks.Open(XLSFileFullName,
Type.Missing, false, Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing);
The code works, but the problem is, how can I check if the Excel file is
already open?? so that I won't use a read-only file, but the already active
file!!
Besides how can I use the alredy opened Excel process, if the latter is
already activated??
Please help me.
Alvin Bruney [Microsoft MVP] - 26 Feb 2005 19:20 GMT
As far as i understand, the excel automation occurs with separate copies.
You may have some success by retrieving a reference to the application name
running on the machine first. If it isn't null, then you can use this
instance in your application.

Signature
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
--------------------------------------------------
> Hi,
> I'm developping a windows application which allows user loading and
[quoted text clipped - 24 lines]
>
> Please help me.