Consulting

Results 1 to 2 of 2

Thread: control internet explorer popup window from excel

  1. #1

    control internet explorer popup window from excel

    Hi,

    I am stuck and after some help...

    I have written a macro which opens internet explorer, fills in the relevant fields then submits the form. occasionally a popup window will appear asking for confirmation which i want to focus on and click the confirm button and then carry on inputting data onto the original internet explorer window. i have been told to use a withevent but i cannot get it to work.

    this is what i have so far:

    this is the code in class1
    [VBA]
    Public WithEvents IeWe As InternetExplorer Private Sub IeWe_NewWindow2(ppDisp As Object) Dim PopupWin As InternetExplorer Set PopupWin = ppDisp 'code to click button .... End Sub
    [/VBA]

    this is the code in a module
    [VBA]
    Dim newopenwin As New Class1 Public Sub gogogo() Dim ie As InternetExplorer Dim objCollection As Object Dim objCollection2 As Object ... Set objCollection = ie.document.getElementsByTagName("td") j = 0 while j < objCollection.Length If objCollection(j).ID = "addLinkSum" Then Set objCollection2 = objCollection(j).getElementsByTagName("a") k = 0 While k < objCollection2.Length If objCollection2(k).innerText = "Add" And added = 0 Then 'when link is clicked popup window appears objCollection2(k).Click End If k = k + 1 Wend End If j = j + 1 Wend ...
    [/VBA]

    can anybody please help??

    thanks

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •