Hi everyone,
I am haing a little trouble with an access app i'm creating which is meant to interact with a website in internet explorer. Here is the code:
The site that opens is a login page. The problem I am having is that for this site, whenever it opens, 1 or two message boxes pop up. This is the reason for the sendkeys portion of the code. I really want to avoid using sendkeys on this as the window doesnt always open on top of the other applications open on my pc. So my question is:
Is there any way to access the message boxes that pop up in IE and simulate clicking the appropriate buttons without using sendkeys or having user interaction?
Any help on this topic would be greatly appreciated as I am totally stumped. Thanks.
I am haing a little trouble with an access app i'm creating which is meant to interact with a website in internet explorer. Here is the code:
Code:
Dim IEX As InternetExplorer
Set IEX = CreateObject("InternetExplorer.Application")
IEX.Visible = True
IEX.Navigate (website name hidden for security reasons)
Do Until IEX.Busy = False
DoEvents
Loop
Sleep 1000
DoEvents
SendKeys "y"
DoEvents
Sleep 250
DoEvents
SendKeys "{ENTER}"
DoEvents
Sleep 1000
Do Until IEX.Busy = False
DoEvents
Loop
IEX.Document.Forms("Form1").Item("Username").Value = Username
IEX.Document.Forms("Form1").Item("password").Value = Password
IEX.Document.Forms("Form1").Item("domain").Value = Domain
IEX.Document.all.Item("submitButton").Click
The site that opens is a login page. The problem I am having is that for this site, whenever it opens, 1 or two message boxes pop up. This is the reason for the sendkeys portion of the code. I really want to avoid using sendkeys on this as the window doesnt always open on top of the other applications open on my pc. So my question is:
Is there any way to access the message boxes that pop up in IE and simulate clicking the appropriate buttons without using sendkeys or having user interaction?
Any help on this topic would be greatly appreciated as I am totally stumped. Thanks.