com.jacob.com.ComFailException: Can't get object clsid from progid

UPDATED: 03 December 2013
JACOB + jacob-project

Exception Stacktrace:
com.jacob.com.ComFailException: Can't get object clsid from progid
 at com.jacob.com.Dispatch.createInstanceNative(Native Method)
 at com.jacob.com.Dispatch.(Dispatch.java:99)
 at com.jacob.activeX.ActiveXComponent.(ActiveXComponent.java:58)
ActiveXComponent comp = new ActiveXComponent("ABCXYZ");
This exception thrown by JACOB library when you try to create ActiveXComponent. Its coming because you are trying to create ActiveXComponent of program that is not installed in your system.


Solution:
You need to find proper CLSID or ProgID or VersionIndependentProgID for your program. Lets create Microsoft Excel's ActiveXComponent
ActiveXComponent comp = new ActiveXComponent("clsid:{00024500-0000-0000-C000-000000000046}");
ActiveXComponent comp = new ActiveXComponent("Excel.Application.14");
ActiveXComponent comp = new ActiveXComponent("Excel.Application");
1. Create ActiveXComponent using CLSID.
2. Create ActiveXComponent using version specific program id.
3. Create ActiveXComponent using version independent program id.

If you want to find CLSID or ProgID or VersionIndependentProgID for your program. Download OLEViewer and browser Object Classes > All Objects


OLEViewer


0 comments :