セルWクリックからIE開く

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
	'WクリックしたセルのX座標チェック&値が入っているか
	If ActiveCell.Column <> 2 Or ActiveCell.Value = "" Then
		Cancel = True
		Exit Sub
	End If

	Dim ObjIE As Object
	Dim ObjShell As Object
	Dim ObjWindow As Object
 
	Set ObjShell = CreateObject("Shell.Application")
	'全shellをチェック
	For Each ObjWindow In ObjShell.Windows
		'IEならば
		If TypeName(ObjWindow.Document) = "HTMLDocument" Then
			Set ObjIE = ObjWindow
			'IEにURLセット&引数
			ObjIE.Navigate ("http:xxxxxxxxxxx=" & ActiveCell.Value)
			ObjIE.Visible = True
			Exit For
		End If
	Next
	Cancel = True
End Sub