Code:
Private Sub CommandButton1_Click()
Dim IE As Object
Dim objPage As Object
Dim wshshell As Object
Set IE = CreateObject("InternetExplorer.Application")
URL = "***"
IE.Visible = True
IE.Navigate URL
While IE.busy
DoEvents
Wend
Set wshshell = CreateObject("WScript.Shell")
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 30
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
wshshell.SendKeys "{F3}"
wshshell.SendKeys "n"
wshshell.SendKeys "a"
wshshell.SendKeys "m"
wshshell.SendKeys "e"
wshshell.SendKeys "{tab}"
wshshell.SendKeys "{tab}"
wshshell.SendKeys "test"
wshshell.SendKeys "{F3}"
wshshell.SendKeys "#"
wshshell.SendKeys "3"
End Sub
here I am trying to automate a web form, as the html code is hidden I am not able to use getelememtbyid methods.
And also I do not have access to spy++, so I an not use windows API calls.
And I am thing of using wscript object in vba .
In the code I am trying to do this:
Launch IE
Open the URL
now comes the problem, there are two dropdown objects
one is 'name' and other 'service #'
inorder to fill these dropdown, I have given find(F3) option to search for the dropdown name. and then pass the value test.
but, when I try running the code. It is not happening as expected.
Pls guide me.
Private Sub CommandButton1_Click()
Dim IE As Object
Dim objPage As Object
Dim wshshell As Object
Set IE = CreateObject("InternetExplorer.Application")
URL = "***"
IE.Visible = True
IE.Navigate URL
While IE.busy
DoEvents
Wend
Set wshshell = CreateObject("WScript.Shell")
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 30
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
wshshell.SendKeys "{F3}"
wshshell.SendKeys "n"
wshshell.SendKeys "a"
wshshell.SendKeys "m"
wshshell.SendKeys "e"
wshshell.SendKeys "{tab}"
wshshell.SendKeys "{tab}"
wshshell.SendKeys "test"
wshshell.SendKeys "{F3}"
wshshell.SendKeys "#"
wshshell.SendKeys "3"
End Sub
here I am trying to automate a web form, as the html code is hidden I am not able to use getelememtbyid methods.
And also I do not have access to spy++, so I an not use windows API calls.
And I am thing of using wscript object in vba .
In the code I am trying to do this:
Launch IE
Open the URL
now comes the problem, there are two dropdown objects
one is 'name' and other 'service #'
inorder to fill these dropdown, I have given find(F3) option to search for the dropdown name. and then pass the value test.
but, when I try running the code. It is not happening as expected.
Pls guide me.