abbaddon223
Registered User.
- Local time
- Today, 07:09
- Joined
- Mar 13, 2010
- Messages
- 162
Hi,
I'm trying to get some information in and out of a web page (very new to this). The code is below. The aim of this is to take information from a form, input it into the site, run a search, then take the returned info and pop it back into some empty fields on the form.
The highlighted red area is where I keep getting a debug: Run Time Error 438: Object Does Not Support This Property or Method.
I'm pretty sure that the field in the web page which I'm referencing is correct. Is there anything else this could be? Thank you in advance for any support.
Private Sub Command0_Click()
'sets focus - possible debug area
[Phone_Number].SetFocus
'Declares Variable
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = True
'Nav to page
ie.navigate "URN Name Removed"
'Pauses whislt page loads
While ie.busy
DoEvents
Wend
'Inputs phone number into Phone Number: field
ie.Document.getElementById("ctl00_ctl00_ContentPlaceholderColumnThree_ctl00_txtTelephone").Value = [Forms]![Frm_Web_Open]![Phone_Number]
'Clicks the go button
ie.Document.all("ctl00_ctl00_ContentPlaceholderColumnThree_ctl00_btnCheckADSL").Click
'waits for search to complete
While ie.busy
DoEvents
Wend
'Get's standard speed
[Current_ADSL_Up].Text = ie.Document.getElementById("ctl00_ctl00_ContentPlaceholderColumnTwo_ctl02_lblSpeedEstimate").Value
End Sub
I'm trying to get some information in and out of a web page (very new to this). The code is below. The aim of this is to take information from a form, input it into the site, run a search, then take the returned info and pop it back into some empty fields on the form.
The highlighted red area is where I keep getting a debug: Run Time Error 438: Object Does Not Support This Property or Method.
I'm pretty sure that the field in the web page which I'm referencing is correct. Is there anything else this could be? Thank you in advance for any support.
Private Sub Command0_Click()
'sets focus - possible debug area
[Phone_Number].SetFocus
'Declares Variable
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = True
'Nav to page
ie.navigate "URN Name Removed"
'Pauses whislt page loads
While ie.busy
DoEvents
Wend
'Inputs phone number into Phone Number: field
ie.Document.getElementById("ctl00_ctl00_ContentPlaceholderColumnThree_ctl00_txtTelephone").Value = [Forms]![Frm_Web_Open]![Phone_Number]
'Clicks the go button
ie.Document.all("ctl00_ctl00_ContentPlaceholderColumnThree_ctl00_btnCheckADSL").Click
'waits for search to complete
While ie.busy
DoEvents
Wend
'Get's standard speed
[Current_ADSL_Up].Text = ie.Document.getElementById("ctl00_ctl00_ContentPlaceholderColumnTwo_ctl02_lblSpeedEstimate").Value
End Sub