delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback



Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi








Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (1)


to check if OLE object is installedGo to Mike Shkolnik's websiteFormat this article printer-friendly!Bookmark function is only available for registered users!
Product:
Delphi all versions
Category:
OLE
Skill Level:
Scoring:
Last Update:
10/04/2002
Search Keys:
delphi delphi3000 article borland vcl code-snippet ole exist install excel word
Times Scored:
2
Visits:
5605
Uploader: Mike Shkolnik
Company: Scalabium Software
Reference: http://www.scalabium.com/faq/dct0143.htm
 
Question/Problem/Abstract:
How can I check if OLE object is installed?
Answer:



Sometimes in development if you use OLE automation of some obejct, your
application will not work because application is not installed on client
computer. For example, you use MS excel automation but MS Excel is not
installed.

You can easy check if OLE object is installed and correctly registered using
CLSIDFromProgID function (for MS Excel as example only):

var
  ClassID: TCLSID;
  strOLEObject: string;
begin
  strOLEObject := 'Excel.Application';
  if (CLSIDFromProgID(PWideChar(WideString(strOLEObject)), ClassID) = S_OK)
then
  begin
    
  end
  else
  begin
    
  end
end;

In same manner you can check any other required OLE object.

With best regards, Mike Shkolnik
EMail: mshkolnik@scalabium.com
http://www.scalabium.com





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment
FYI
    Jason Pierce (Jan 14 2004 11:46AM)

Good day,

In Delphi 7, you will need to include the ActieX unit to work with the CLSIDFromProgID() function and the TCLSID type.

-Jason
Respond














 
Sign up to consume product discounts for Bronze memberships !

read more


   


  Community Ad of
M. Kleiner
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)