|
发表于 2020-6-30 09:30:01
|
显示全部楼层
检查注册表里面有没有相应的键值,给你个检测是否安装了excel的例子
Public Const HKEY_LOCAL_MACHINE As Long = &H80000002
Public Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Dim lRet As Long, hKey As Long
lRet = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Office\11.0\Excel", hKey)
If lRet <> 0 Then
'no excel instralled
Else
'excel installed
lRet = RegCloseKey(hKey)
End If
Matlab的键值你找台安装过的打开注册表看看就知道了
另外一种方法就是,你创建matlab对象,如果出错就说明机器上没有安装 |
|