Option Explicit
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub TableControl()
Dim ie As InternetExplorer
Dim targetURL As String: targetURL = "http://www.ikachi.org/sample/sample10.html";
Set ie = GetIEObject(targetURL)

If (ie.LocationURL = "") Then
MsgBox "Plz Open the Web page"
Exit Sub
End If
End Sub

Public Function GetIEObject(ByVal targetURL As String) As InternetExplorer
Set GetIEObject = Nothing

Dim sh As Object
Set sh = CreateObject("Shell.Application")

Dim w As Object
For Each w In sh.Windows
If (TypeOf w Is InternetExplorer) And (w.LocationURL = targetURL) Then
Set GetIEObject = w
Exit For
End If
Next
End Function
でie.LocationURL = ""でエラーが出るのですが、booleanだがらでしょうか?