Code to check whether word,excel has been indtalled in system

This is code to check whether microsoft word or microsoft excel has been installed in your system..

import namespace microsoft.win32 'namespace to acess the Registry classes.

Dim RegAppli As RegistryKey
RegAppli = Registry.ClassesRoot.OpenSubKey("excel.application")
'in case of checking word installed,the above code should be RegAppli = 'Registry.ClassesRoot.OpenSubKey("word.application")
If RegAppli Is Nothing Then
MsgBox("Microsoft Excel has not been installed")
Else
MsgBox("Microsoft Excel has been installed")
RegAppli.Close()
End If

No comments:

Post a Comment