Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / February 2005

Tip: Looking for answers? Try searching our database.

Microsoft.Office.Interop.Excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Siu - 14 Feb 2005 10:27 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.