title: XmlHttp Post in Excel VBA not updating website form
body: <p>I routinely have to search the state of NV for unclaimed property and put the results in an Excel spreadsheet. I am trying to automate the process but I'm limited to using Excel 2010 and VBA. Below is the URL to the site I'm trying to submit a form using xmlhttp.</p>
  
  <p>URL: <a href="https://nevadatreasurer.gov/UPSearch/" rel="nofollow">https://nevadatreasurer.gov/UPSearch/</a></p>
  
  <p>I created a class to automate submitting forms on other websites but no matter what I enter in the postdata the form is never submitted. Below is my submission, and method to submit the form.</p>
  
  <p>Call to class:</p>
  
  <pre><code>cXML.openWebsite "Post", "https://nevadatreasurer.gov/UPSearch/Index.aspx", _
                   "ctl04$txtOwner=" &amp; strSearchName
  </code></pre>
  
  <p>Class method:</p>
  
  <pre><code>Public Sub openWebsite(strOpenMethod As String, strURL As String, _
  Optional strPostData As String)
  
  pXmlHttp.Open strOpenMethod, strURL
  
  
  If strPostData &lt;&gt; "" Then
      strPostData = convertSpaceToPlus(strPostData)
      pXmlHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
      pXmlHttp.send (strPostData)
  Else
      pXmlHttp.send
  End If
  
  'Create DOM html documnet
  pHtmlObj.body.innerHTML = pXmlHttp.responseText
  
  End Sub
  </code></pre>
  
  <p>Each time the <code>responseText</code> is the main website with no updates, as if I submitted no postdata. I'm fairly new to IE automation but can someone provide a reason why this isn't working and a code example that works?</p>
  
  <p>Thanks!</p>
  
  <p>Update: 7/26/13 8:30am PST</p>
  
  <p>Without any changes to my method I was able to submit forms through another website. The state of OR unclaimed property form. It worked perfect!</p>
  
  <p>URL: <a href="https://oregonup.us/upweb/up/UP_search.asp" rel="nofollow">https://oregonup.us/upweb/up/UP_search.asp</a> </p>
  
  <p>However I ran into the same problem when I tried the state of CA unclaimed property website. No matter what I do, the <code>responseText</code> is always the original search page with no update.</p>
  
  <p>URL: <a href="https://scoweb.sco.ca.gov/UCP/Default.aspx" rel="nofollow">https://scoweb.sco.ca.gov/UCP/Default.aspx</a></p>
  
  <p>It still does not work with the state of NV on my original post. I am using the proper post data, URL encoded for each website and can see no difference. Any help would be appreciated.</p>