title: Trying to retrieve xml data from a website through excel
body: <p>I am writing an excel spreadsheet for use with a game called Eve Online. My spreadsheet needs to automatically retrieve data through a data provider website called eve-marketdata.com. On the developer page of eve-marketdata: <a href="http://eve-marketdata.com/developers/item_history2.php" rel="nofollow">http://eve-marketdata.com/developers/item_history2.php</a> it gives some instructions on how to request data by sending a 'post' request through http. </p>
  
  <p>For instance: The url used for a market history request would be: <a href="http://api.eve-marketdata.com/api/item_history2.xml?char_name=venoushka" rel="nofollow">http://api.eve-marketdata.com/api/item_history2.xml?char_name=venoushka</a> patel then, lets say I want to retrieve 45 days of data for item id 34, from region 10000002. I would put at the end of the url: item_id=34, days=45 and region_ids=10000002 each separated by the &amp; symbol for a finished product of: api.eve-marketdata.com/api/item_history2.xml?char_name=venoushka patel&amp;type_ids=34&amp;region_ids=10000002&amp;days=45  (removed the http:// due to posting regulations on this site)</p>
  
  <p>So, I need certain cells to use the info in the spreadsheet such as item ids, region ids, etc, to parse together the appropriate url, submit the url to the site and then grab only the info that I am looking for and place it into a cell. This is currently much easier on google docs instead of excel because of their 'importxml' feature utilizing xpath. However, google docs limit the number of xml calls to 50 per spreadsheet and my spreadsheet is going to have a few thousand, so I HAVE to use excel.</p>
  
  <p>And no, I am not going to use the 'import from web' or 'map xml' to cells features in excel because I have thousands of these to do in a spreadsheet, not time or resource efficient.</p>
  
  <p>I've been told that this can be done using the following vba code:</p>
  
  <pre><code>Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
  URL = "http://www.somedomain.com"
  objHTTP.Open "POST", URL, False
  objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
  objHTTP.send ("")
  </code></pre>
  
  <p>The problem is, although i'm very good at programing excel spreadsheets, I have never used VBA before. I know how to open the visual basic editor but that is about it. First off:</p>
  
  <p>How would I paste this into the vba editor and then call upon it in my workbook? I believe I would have to put something like function () at the beginning and end function at the end, right?</p>
  
  <p>How would I call upon this function in my worksheet to do what I need it to do? </p>
  
  <p>Could someone explain what the above code does, and how I need to modify it to perform my task?</p>
  
  <p>In advance, I REALLY APPRECIATE any help received on this and there is a huge part of the community (thousands out there) that need a way to do this as well!</p>