Can I get the stream from an Excel VBA Web Query?

Deadly 提交于 2019-12-06 03:55:53

If you want more control, you could switch from the web query to something like using an instance of xmlhttp: this can be used asynchronously (not super-simple, but quite do-able):

http://www.dailydoseofexcel.com/archives/2006/10/09/async-xmlhttp-calls/

Note there's no guarantee that when you send a large block of symbols the webservice returns the response for each symbol individually: it's common for servers to buffer content until the entire response is complete.

You might be better off chunking your quotes into multiple requests, each with a smaller number of symbols.

mcw0933

If you want full access to the results of the web call, you could open the URL as another workbook instead of using a Web Query.

See my answer on this question: How can I post-process the data from an Excel web query when the query is complete?

The tradeoff of that approach is you have to manage processing the data you get back yourself - Excel won't put it in a given destination for you. But it sounds like that's maybe ok with you?

It's a synchronous call, but you do get a progress bar, so the user experience is better.

We ended up going this route after we tried something pretty similar to what you seem to have been doing.

barrowc

If you are working with a large XML document then you might find that processing the results via SAX rather than DOM makes things less prone to freezing up. You might find this answer to a related question to be of use

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!