Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check, programmatically, if MS Excel exists on a pc?

I have an application that needs MS Excel to run, otherwise it crashes. So I want to check and warn the user in case Excel is not installed on user's machine.

How do I do this?

like image 320
Christos Karapapas Avatar asked Aug 19 '11 14:08

Christos Karapapas


People also ask

How do I know if Excel is installed?

So, the below code is used to check whether Excel is installed or not. Type officeType = Type. GetTypeFromProgID("Excel. Application"); if (officeType == null) { // Excel is not installed. // Show message or alert that Excel is not installed. }

How do I find where my Excel is installed?

The executable file for Excel – Excel.exe – is located in the installation directory for the 64-bit version of Microsoft Office 365 at C:\Program Files\Microsoft Office\root\Office16.

How to check Excel version in c#?

Application(); // getting version of Server's Excel Application string versionName = xApp. Version; int length = versionName. IndexOf('. '); versionName = versionName.

How do I use Microsoft Office Interop Excel in .NET core?

Office. Interop. Excel' nuget package, and then add reference to 'Microsoft Excel 16.0 Object Library' (right click the project -> 'Add' -> 'Reference' -> search and add 'Microsoft Excel 16.0 Object Library' ). Click ''Interop.


1 Answers

Type officeType = Type.GetTypeFromProgID("Excel.Application"); if (officeType == null) {      //no Excel installed } else {      //Excel installed } 
like image 158
Alec Sanger Avatar answered Sep 23 '22 09:09

Alec Sanger