views:

58

answers:

3

I have a windows form application that when it starts needs to see if the user has Excel installed on the computer and if not display a message informing user that part of functionality will be disabled.

Is their an easy way to perform this check?

Working in Visual Studio 2008 with VB.Net

+3  A: 

This will check the registry and tell you the version: (need to Import Microsoft.Win32)

Image

Dim regKey = My.Computer.Registry.ClassesRoot.OpenSubKey("Excel.Application", False).OpenSubKey("CurVer", False)

Console.WriteLine(regKey.GetValue("").ToString())

http://vbcity.com/forums/p/160664/688143.aspx#688143

JTA
A: 

Check if there is a registry entry for .xls-files under HKCR.

Anders Abel
+2  A: 

http://www.xldennis.com/dloads/checkexcelversion.txt

As an excerpt:

Const stXL_SUBKEY As String = "\Excel.Application\CurVer"
Dim rkVersionKey As RegistryKey = Nothing
rkVersionKey = Registry.ClassesRoot.OpenSubKey(name:=stXL_SUBKEY, writable:=False)

If rkVersionKey Is Nothing Then
   'not installed
End If
brydgesk