Hi Mansi,
You can try to create an instance of Excel.Application object - if an
exception is thrown, Excel is most likely not installed.
As for specific version, you can use a version-dependent ProgID - say,
Excel.Application.9.0.
I think you can additionally check certain registry entries, but the check
above should be the primary one - if you are unable to access Excel through
COM interop, it's of no use for your app eve if it's been installed.
--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx
"Mansi" <Ma***@discussions.microsoft.com> wrote in message
news:A8**********************************@microsof t.com...
I'm trying to automate excel from visual c#. One thing I need to be able
to
test is if excel is even installed on the target machine and what version
of
excel is installed on the target machine. Is there a way to do this via
c#
code?
Thanks.
Mansi