So I'm creating an application that automates a job. Basically, it opens internet explorer, points to a user driven URL, selects the "check all" then selects delete.
My issue is, when delete is hit, a messagebox pops up that wants to confirm "do you want to delete all records?"
i've tried the sendkey with no luck.
any suggestions?
heres my code.
Code:Public Class Form1 Dim oInputs As Object Dim oWShell As Object Private Sub btndel_Click(sender As Object, e As EventArgs) Handles btndel.Click With CreateObject("InternetExplorer.Application") .visible = True .Navigate(txturl.Text) Threading.Thread.Sleep(3000) oInputs = .document.getElementsbytagname("a") For Each elm In oInputs If InStr(elm.innertext, "(Un)Check All") > 0 Then elm.click() Exit For End If Next For Each elm In oInputs If InStr(elm.innertext, "Delete") > 0 Then elm.click() Exit For End If Next Do While .busy Or .readystate <> 4 Threading.Thread.Sleep(2000) Loop End With Threading.Thread.Sleep(5000) oWShell = CreateObject("wscript.shell") Do Until oWShell.AppActivate("Message from webpage") Threading.Thread.Sleep(2000) Loop Threading.Thread.Sleep(2000) AppActivate("Message from webpage") oWShell.sendkeys.send("{ENTER"}) End Sub




Reply With Quote
