Reputation: 1508
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
Upvotes: 3
Views: 3367
Reputation: 20794
This will check the registry and tell you the version: (need to Import Microsoft.Win32)
(source: vbcity.com)
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
Upvotes: 4
Reputation: 864
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
Upvotes: 5
Reputation: 69300
Check if there is a registry entry for .xls-files under HKCR.
Upvotes: 0