BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How get Reference to Running Excel Application

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Prabhat
Guest





PostPosted: Fri Aug 26, 2005 3:03 pm    Post subject: How get Reference to Running Excel Application Reply with quote



Hi All,

How can i write a code in delphi that will do the below task:

1) How Do I check If Excel is running or not?

2) If Not running then I will open a New Excel Application with a Excel
Document.

3) If Running, Then which document is open (or) if the document test.xls is
open or not.

Please help me to get the sample code.

Thanks
Prabhat


Back to top
Mike Shkolnik
Guest





PostPosted: Fri Aug 26, 2005 8:12 pm    Post subject: Re: How get Reference to Running Excel Application Reply with quote



try
xls := GetActiveOleObject('Excel.Application');
except
xls := CreateOleObject('Excel.Application');
end;

To check if document active, you must iterate the xls.Wordkbooks collection

--
With best regards, Mike Shkolnik
E-mail: [email]mshkolnik (AT) scalabium (DOT) com[/email]
WEB: http://www.scalabium.com

"Prabhat" <not_a_mail (AT) hotmail (DOT) com> wrote

Quote:
Hi All,

How can i write a code in delphi that will do the below task:

1) How Do I check If Excel is running or not?

2) If Not running then I will open a New Excel Application with a Excel
Document.

3) If Running, Then which document is open (or) if the document test.xls
is
open or not.

Please help me to get the sample code.

Thanks
Prabhat





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.