0

I have a webpage which is in xml and I'd like to read this information into an excel macro that I am making. However, I'm not quite sure how to go about it in visual basic. I've been coming at it like this...

Set wb = Workbooks.OpenXML(Filename:=requestURL, LoadOption:=xlXmlLoadImportToList)

Which is OK in a sense that I get the data into a workbook that I can then manipulate. However, I'd much prefer for the data not to be put into a workbook, i.e read it in directly. I've seen some people approach this by reading the webpage and storing it as a string first, but I'm wondering if there is a more direct approach built-in to VBA? Thanks.

1
  • 1
    See this Q+A. Commented Apr 14, 2013 at 20:15

1 Answer 1

1

I'm not sure what approach you've seen, but the most direct way to handle this in VBA is to send a GET request via the MSMXL2.XMLHTTP object and get back the XML file. Then create an MSXML2.DOMDocument and fill it from the ResponseXML property of the XMLHTTP.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.