Hi Everyone,
Please help me on this problem I had. This issue made me stuck in proceeding and I'm afraid that it will lead me to nothing. I've already created a script that will automatically navigate the page and extracting the file. But the dialogue box in IE made me stuck. Please help me to have code that can click the "Open" or "Save" button in the dialogue box. This dialogue box is not part of the webpage anymore. Below is my current code. Please help. I need your brilliant mind.
Thank you
Sub extract()
Dim IE As New SHDocVw.InternetExplorer
Set IE = New InternetExplorerMedium
Dim HTMLDoc1 As HTMLDocument
Dim HTMLDoc2 As HTMLDocument
Dim frame1 As HTMLFrameElement
Dim frame2 As HTMLFrameElement
Dim HTMLButton1 As HTMLButtonElement
Dim HTMLButton2 As HTMLButtonElement
Dim HTMLButton3 As HTMLButtonElement
Dim HTMLTextBox1 As HTMLInputTextElement
IE.Visible = True
'This is the link to navigate the page
IE.navigate "URL HERE"
Do While IE.readyState <> READYSTATE_COMPLETE
Loop
'This will click the Variable Screen Button
Application.Wait (Now + TimeValue("0:00:05")) 'Wait for 5 seconds to make the page fully loaded
Set HTMLDoc1 = IE.document
Set frame1 = HTMLDoc1.getElementsByName("iframe_Roundtrip_9223372036563636042")(0)
Set HTMLDoc1 = frame1.contentDocument
Set HTMLButton1 = HTMLDoc1.getElementById("BUTTON_OPEN_SAVE_btn3_acButton")
HTMLButton1.Click
'This will click the button OK in the pop up window
Application.Wait (Now + TimeValue("0:00:05")) 'Wait for 5 seconds to make the page fully loaded
Set HTMLDoc2 = IE.document
Set frame2 = HTMLDoc2.getElementsByName("urPopupOuter0")(0)
Set HTMLDoc2 = frame2.contentDocument
Set HTMLButton2 = HTMLDoc2.getElementById("BUTTON_0")
HTMLButton2.Click
'This will click the Export to Microsoft Excel Button
Application.Wait (Now + TimeValue("0:00:05")) 'Wait for 5 seconds to make the page fully loaded
Set HTMLDoc1 = IE.document
Set frame1 = HTMLDoc1.getElementsByName("iframe_Roundtrip_9223372036563636042")(0)
Set HTMLDoc1 = frame1.contentDocument
Set HTMLButton3 = HTMLDoc1.getElementById("BUTTON_TOOLBAR_2_btn3_acButton")
HTMLButton3.Click
'CODE to click the "open" or "save" button for DIALOG BOX.
End Sub
Bookmarks