| 
    
     |  | Google のサイトを表示するとして・・ 
 Private Sub CommandButton2_Click()
 Dim MyShell As Object, MyWindow As Object
 Dim objIE As Object
 Const TgURL As String = "http://www.google.co.jp/"
 
 Set MyShell= CreateObject("Shell.Application")
 For Each MyWindow In MyShell.Windows
 If TypeName(MyWindow.document) = "HTMLDocument" Then
 Set objIE = MyWindow: Exit For
 End If
 Next
 If objIE Is Nothing Then
 Set objIE = CreateObject("InternetExplorer.Application")
 End If
 With objIE
 .Visible = True
 .Navigate TgURL
 Do While .Busy: DoEvents: Loop
 Do While .ReadyState <> 4: DoEvents: Loop
 Loop
 Set MyShell = Nothing: Set objIE = Nothing
 End Sub
 
 などとします。
 
 |  |