Dim objWshShell ' WshShell オブジェクト Dim nReInstallVal Dim strMsg
nReInstallVal = 0
Set objWshShell = CreateObject("WScript.Shell") If Err.Number = 0 Then nReInstallVal = objWshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\XXXX\XXXX\Val") Else msgbox( "エラー" ) End If