How to determine whether excel is installed on the system or not

  • Thread starter Thread starter Shravan
  • Start date Start date
S

Shravan

Hi,
In my application I need to determine whether Excel is
installed on my system or not.
Can anybody tell me how to check that.

Thanks,
Shravan.
 
Hi Shravan,

You can try creating an Excel Application object instance via
COM Interop, late-binding via its prog ID "Excel.Application".
- Do this within a try-catch block.
If an exception is thrown, its likely that Excel is not
installed in the machine.

Checking the registry for the appropriate keys would be another
way to do it - Maybe check for the presence of the
HKEY_CLASSES_ROOT\Excel.Application key.

Regards,
Aravind C
 
It's probably better to check the registry since Excel XP and higher can
still throw an exception if certain permissions aren't granted to allow you
to do automation.
 
Back
Top