Option Explicit Dim strWMI, strComputer, strStatus, strPrompt, strTitle, strKeyPath Dim strValueName Dim dwHKEY_CURRENT_USER, dwValue Dim objReg dwHKEY_CURRENT_USER = &H80000001 strWMI = "winmgmts:\\" strComputer = "." strStatus = "Current setting for signed ActiveX" & vbNewLine strStatus = strStatus & "controls in the Internet zone is: " & vbNewLine strPrompt = "Allow download of signed ActiveX controls?" strTitle = "ActiveX Setting" strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings" strKeyPath = strKeyPath & "\Zones\3" strValueName = "1001" Set objReg = GetObject(strWMI & strComputer & "\root\default:StdRegProv") objReg.GetDWORDValue dwHKEY_CURRENT_USER, strKeyPath, strValueName, dwValue ' Display current ActiveX setting Select Case dwValue Case 0 MsgBox strStatus & "Enabled - This setting is highly insecure", _ vbOKOnly, strTitle Case 1 MsgBox strStatus & "You are prompted before downloading", _ vbOKOnly, strTitle Case 3 MsgBox strStatus & "Disabled - signed controls are not " & _ "downloaded", vbOKOnly, strTitle Case Else MsgBox "Download signed ActiveX components from a Web page " & _ "(Zone 3): The value is either Null or could not be " & _ "found in the registry.", vbOKOnly, strTitle End Select ' Display the message box and act on resulting button click Select Case MsgBox(strPrompt, vbYesNoCancel, strTitle) Case vbYes 'Enable ActiveX objReg.CreateKey dwHKEY_CURRENT_USER, strKeyPath strValueName = "1001" dwValue = 1 objReg.SetDWORDValue dwHKEY_CURRENT_USER, strKeyPath, _ strValueName, dwValue Case vbNo 'Disable ActiveX objReg.CreateKey dwHKEY_CURRENT_USER, strKeyPath strValueName = "1001" dwValue = 3 objReg.SetDWORDValue dwHKEY_CURRENT_USER, strKeyPath, _ strValueName, dwValue Case vbCancel 'Do nothing End Select