Author: Mike Shkolnik
How can I check if OLE object is installed?
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):
1 var2 ClassID: TCLSID;
3 strOLEObject: string;
4 begin5 strOLEObject := 'Excel.Application';
6 if (CLSIDFromProgID(PWideChar(WideString(strOLEObject)), ClassID) = S_OK) then7 begin8 9 end10 else11 begin12 13 end14 end;
In same manner you can check any other required OLE object.