DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to know if Excel or a workbook is open ???

 
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming
View previous topic :: View next topic  
Author Message
Dave_lopez
Member


Joined: 12 May 2004
Posts: 3
Location: Paris

PostPosted: 12/05/04 09:55    Post subject: How to know if Excel or a workbook is open ??? Reply with quote

Hi (Bonjour)
I just wanna know how to know if a workbooks is open.

I used to use this but it does'nt work the count method always send back
the zero value:


Code:
If form2.ExcelApplication1.Workbooks.Count <> 0 Then
   begin
     for cpt := 0 to form2.ExcelApplication1.Workbooks.Count
      do
       form2.ExcelApplication1.Workbooks.Close( cpt);

end;

I need your help.
Merci / Thanks

_________________
Destiny exists ...
Back to top
View user's profile
Dave_lopez
Member


Joined: 12 May 2004
Posts: 3
Location: Paris

PostPosted: 12/05/04 11:16    Post subject: Reply with quote

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

_________________
Destiny exists ...
Back to top
View user's profile
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> Delphi Programming 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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group