samedi 24 janvier 2015

excel web query in vba

I have a worksheet that currently updates about 200 stocks using Yahoo Finance API and MSXML. I would like to also get some other info from other websites that don't have an api, for example "http://ift.tt/1BX4vjM".


Also for example, if you look at some info from that web page below, you see there is a Release Date of 1/29/2015. There is also some text in between, currently "[not confirmed]", but at some point it will change to "[confirmed]" and both items of text are of interest.


For lack of better web skills, I currently have a single sheet with a QueryTable that is refreshed in a code synchronously. It works...eventually. I would rather work with the response in code, but I don't know how to do that. I don't need this particular info to be auto refreshed.


Questions



  1. Is there a preferred VBA way work with the html response? Can you show a code snippet to illustrate?

  2. Is it possible to convert the html to xml or json relatively easy? code snippet?

  3. If QueryTable is in fact the good enough solution, would it be faster to create a sheet for each stock and refresh async, using events?


I know there is oodles of info on the web, but most of it seems dated and confusing. I am using Excel 2013.


Cheers


enter image description here





Aucun commentaire:

Enregistrer un commentaire