?
Solved

http post from excel using macro

Posted on 2014-07-20
2
Medium Priority
?
1,133 Views
Last Modified: 2014-07-21
Folks

How can I build an http call in a vb macro and parse the results into excel, the code works

POST http://testproject:80/integration/os/resources
Content-Type: text/xml
<max:QueryRESOURCES xmlns:max="http://www.vendor.com/projects">
 <max:RESOURCES Query>
  <max:WHERE>upper(FIRSTNAME) like 'A%'</max:WHERE>
 </max:RESOURCES Query>
</max:QueryRESOURCES
0
Comment
Question by:rutgermons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 46

Accepted Solution

by:
aikimark earned 2000 total points
ID: 40208035
Have you tried using the msxml2.xmlhttp object to handle the send and capture the response?
In the following example, I used testproject.com:80
Example:
    Dim strXML, oXML, strResponse
    Set oXML = CreateObject("msxml2.xmlhttp")
    oXML.Open "POST", "http://testproject.com:80/integration/os/resources", False
    oXML.setrequestheader "Content-Type", "text/xml"
    strXML = "<max:QueryRESOURCES xmlns:max=""http://www.vendor.com/projects"">"
    strXML = strXML & "<max:RESOURCES Query>"
    strXML = strXML & "<max:WHERE>upper(FIRSTNAME) like 'A%'</max:WHERE>"
    strXML = strXML & "</max:RESOURCES Query>"
    strXML = strXML & "</max:QueryRESOURCES>"
    oXML.Send strXML
    
    strResponse = oXML.responsetext

Open in new window

http://support.microsoft.com/kb/290591
0
 

Author Comment

by:rutgermons
ID: 40208429
thanks! i'll prob ask a follow up question on this in how to map the xml to columns (next step)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question