Closing a web browser dialog

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • huckeuri
    New Member
    • Sep 2010
    • 1

    #1

    Closing a web browser dialog

    Hi all,
    I have a VB automating an IE web browser.
    At certain URLs the IE raises modal dialogs.
    My question is how do i close it by automation since i can't continue navigating till the dialog is closed.

    the code looks like this:
    Code:
        Dim IE As Object
        IE = CreateObject("InternetExplorer.Application")
        IE.Navigate2(someURL, 0, "", "", Header)
    As mentioned after this line a model dialog pops up and i need to close it before i can continue to navigate to other URLs.

    Thanks for the help.
    Last edited by Frinavale; Sep 10 '10, 06:29 PM. Reason: Please post code in [code] ... [/code] tags. Added code tags.
  • ZiadElmalki
    New Member
    • Sep 2010
    • 43

    #2
    What kind of dialog? Is it an alert? I think on the browser control there is an execute script method that will allow you to execute some javascript in the browser. You could override the browsers alert function so it does not do anything. Execute some thing like below to over the alert to an empty method.

    window.alert=fu nction() {};

    Comment

    Working...