vba create object to access website error
vba create object to access website error
vba create object to access website error
vba create object to access website error
vba create object to access website error
vba create object to access website error vba create object to access website error vba create object to access website error vba create object to access website error vba create object to access website error vba create object to access website error vba create object to access website error vba create object to access website error
vba create object to access website error vba create object to access website error
vba create object to access website error
Go Back  Xtreme Visual Basic Talk > > > vba create object to access website error


Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2015, 10:11 AM
pandale pandale is offline
Newcomer
 
Join Date: Jan 2015
Posts: 1
Default vba create object to access website error


i'm new to objects when i run the code below, i get the error message on the "Get" line

runtime error 1004 object-defined error

i'm open to suggestions if you have a better way to do this.

Sub get_correct_address()

Dim x As Long, y As Long
Dim htm As Object

Set htm = CreateObject("htmlFile")

With CreateObject("msxml2.xmlhttp")
.Open "GET", "http://production.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=<AddressValidateRequest%20USERID="" 968APPRA1046"">" & _
"<Address>" & _
"<Address1></Address1>" & _
"<Address2>" & CStr(Sheets("import").Cells(row, StrNumCol).value) + " " + Sheets("import").Cells(row, StrNamCol).value + " " + Sheets("import").Cells(row, StrTypCol).value & "</Address2>" & _
"<City>" & CStr(Sheets("import").Cells(row, CityCol).value) & "</City>" & _
"<State>" & CStr(Sheets("import").Cells(row, StateCol).value) & "</State>" & _
"<Zip5></Zip5>" & _
"<Zip4>" & CStr(Sheets("import").Cells(row, ZipCol).value) & "</Zip4>" & _
"</Address>" & _
"</AddressValidateRequest>" & _
""", False"
.send
htm.body.innerhtml = .responsetext
End With
Debug.Print (qry)

With htm.getelementbyid("comps-results")
For x = 0 To .Rows.length - 1
For y = 0 To .Rows(x).Cells.length - 1
Sheets(1).Cells(x + 1, y + 1).value = .Rows(x).Cells(y).innertext
Next y
Next x
End With

'http://production.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=<AddressValidateRequest%20USERID="x xxxxxxxxxxx">

End Sub
Reply With Quote
Reply

Tags
createobject, html, http, vba error


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
vba create object to access website error
vba create object to access website error
vba create object to access website error vba create object to access website error
vba create object to access website error
vba create object to access website error
vba create object to access website error vba create object to access website error vba create object to access website error vba create object to access website error vba create object to access website error vba create object to access website error vba create object to access website error
vba create object to access website error
vba create object to access website error
 
vba create object to access website error
vba create object to access website error
 
-->