How to check word, excel are installed in the machine

  • Thread starter Thread starter santel
  • Start date Start date
S

santel

Hi,

How to check whether the MSOffice files like word, excel, powerpoint
are installed in the machine or not? Anyone please help!
 
Hi,

How to check whether the MSOffice files like word, excel, powerpoint
are installed in the machine or not? Anyone please help!

There are a few ways. You could try the following:

try
{
Type officeType = Type.GetTypeFromProgID("Excel.Application");
if (officeType == null)
{
Console.WriteLine("Excel is missing");
}
else
{
Console.WriteLine("Excel is present");
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}

Or you could have a look in the registry for things like:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Excel\InstallRoot
and then check in that path for excel.exe.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top