Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

起動しているIEをShell.Windows を使い .Quitで 全て閉じたい

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
580 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Mar 26, 2009

ソースは http://ken3-info.blog.ocn.ne.jp/objie/2009/03/327_ie_5a92.html を見てください。

起動しているIEを全て閉じたいと質問があったので、少し探ってみました。 '後ろから消してく。 For n = objShell.Windows.Count To 1 Step -1 'MAXから-1ひいてく感じ Set objIE = objShell.Windows(n - 1) 'n番目のウインドウを代入 MsgBox "確認" & objIE objIE.Quit Next Set objShell = Nothing

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (0)

Sign In or Sign Up now to post a comment!
  • Sub ccc() 'ここで、.Quitで終わらせる。  Dim objShell As Object Dim objIE As Object Dim n As Integer Set objShell = CreateObject("Shell.Applicatio­n") '後ろから消してく。 For n = objShell.Windows.Count To 1 Step -1 'MAXから-1ひいてく感じ Set objIE = objShell.Windows(n - 1) 'n番目のウインドウを代入 MsgBox "確認" & objIE objIE.Quit Next Set objShell = Nothing

    End Sub

  • ※ループ中にobjShell.Windowsの内容が変化して­しまうので、

     For Each objWindow In objShell.Windows で 順番に取得できないみたいです。

    なので、後ろからまわしてみる。そんな処理に変更してみました。

  • Sub bbb() 'ここで、.Quitで終わらせる。 Dim objShell As Object Dim objWindow As Object Dim objIE As Object Set objShell = CreateObject("Shell.Applicatio­n") For Each objWindow In objShell.Windows Debug.Print objShell.Windows.Count Set objIE = objWindow  MsgBox "確認" & objIE & objShell.Windows.Count objIE.Quit Next Set objShell = Nothing

    End Sub

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more